A standard tank replacement in San Diego typically runs $1,400-$3,200 installed. A tankless install typically runs $3,200-$6,500, and the high end shows up when the gas line has to be enlarged or the vent has to be rebuilt.
Tankless is not automatically the better heater here. Our water is hard. Scale loves a tankless heat exchanger, and a unit that is not flushed will lose flow. A tank also scales, which is why older heaters rumble, but the failure is slower and the replacement is simpler.
Pick a tankless when the household actually runs out of hot water, the gas supply can feed it, and someone will flush it. Pick a tank when you want a straight replacement, the closet is already vented for a tank, and you do not want to rebuild the gas line.
Either way the heater needs a permit in many cities in this county, and a storage tank needs seismic strapping. If the old pilot will not stay lit and the tank is past 10 years, price the replacement beside the thermocouple repair. Sometimes the repair is the right spend. Sometimes it is a way to delay a tank that is already leaking from the bottom.
Pipe Pro SD matches you with a local plumber. Get both numbers in writing.