Sewer flies are common with open ends into the sewer system without a trap to protect the sewer gases from entering. I would venture to say that there is a leak somewhere that is being overlooked, and I do not believe replacing your sewer line fixes the problem. A smoke test of the DWV system will decipher exactly where the sewer flies are coming from. Lack of use of plumbing fixtures is usually the #1 cause of this problem. Like a floor drain or sink that doesn't see much use and the trap seal evaporates inbetween uses.