This paper develops an innovative approach to optimize a long-term rehabilitation and upgrading schedule (RUS) for a water distribution system with considering both hydraulic failure and mechanical performance failure circumstances. The proposed approach assesses hydraulic reliability dynamically and then optimizes the long-term RUS in sequence for a water distribution system. The uncertain hydraulic parameters are treated as random numbers in a stochastic hydraulic reliability assessment. The methodologies used for optimization in a stochastic environment are: Monte Carlo Simulation, EPANET Simulation, Genetic Algorithms, Shamir and Howard's Exponential Model, Threshold Break Rate Model and Two-Stage Optimization Model. The proposed approach is conducted on a simulation model of water distribution network in a computer by two universal codes, namely the hydraulic reliability code and the optimal RUS code. The applicability of this approach is verified in an example of a benchmark water distribution network.