Even if they need to replace every single lithography machine, there are a lot of other machines that probably don't need to be replaced for any given upgrade.

Like everything related to it being a clean room; All the logistics robots which move wafers around; All the machines that deposit layers of material like CVD/AVD/Sputtering; The various machines that do the actual etching; The furnaces; The inspection and quality control equipment;

Also, absolutely everything to do with dicing and packaging. But that's usually already at another factory (often a completely different company) due to how process agnostic it is. Same applies to growing and prepping the silicon wafer.