Hayward pool heater heat exchanger repair

My heater has been leaking a bit for a while so I finally took it apart and removed the heat exchanger and the manifold. On the outlet side, the pipes are eroded down to nubs. Any ideas on fixing this?