The answer to 'when to replace water line' is that you should generally replace your water line every 20-50 years, depending on the material and condition of the pipe. Older galvanized steel or lead pipes are more prone to corrosion and mineral buildup, and may need replacement sooner. Copper and PEX pipes typically last 40-50 years with proper maintenance. Signs it's time to replace your water line include low water pressure, discolored water, frequent leaks, and pipe damage or deterioration.
Replacing your water line is an important home maintenance task, as a failing water line can cause major water damage and costly repairs. It's best to have a professional plumber evaluate your home's water line and determine if replacement is needed.