We don't rewrite from scratch.
Rewriting means risking losing business logic, getting stuck for half a year, and ending up with a new pile of problems. We work iteratively: refactor critical parts, cover with tests, extract services, update dependencies — and at each step the system remains operational.