On this subject, I recommend Marianne Bellotti‘s
“Kill It with Fire: Manage Aging Computer Systems (and Future Proof Modern Ones)”. She has managed the maintenance and modernization of large legacy systems at the United States Digital Service.
https://nostarch.com/kill-it-fire