Every legacy system is somebody's working business. The spreadsheet nobody documented is load-bearing. The rewrite that ignores this ships a technically superior product that cannot do payroll.
Route around, don't rip out
The strangler-fig pattern puts a routing layer in front of the old system, then moves one capability at a time behind it. Each move is small, reversible and independently valuable. The old system shrinks until switching it off is a non-event.
- Pick the highest-pain, lowest-coupling capability first.
- Keep both paths live until the new one is proven under real load.
- Delete the old code once traffic is zero — not before.
Instrument before you change anything
You cannot safely replace behaviour you cannot observe. Logging, tracing and a few well-chosen metrics turn 'it feels slower' into a number, and give you the evidence to prove a migration step was safe.