Migrating a legacy PHP app without a big-bang rewrite
Full rewrites are where roadmaps go to die: months with nothing to show, a moving target, and a cutover nobody trusts. Migrate incrementally instead.
Stabilise first
Get the legacy app into version control, running locally, and behind a few end-to-end tests on the money paths. You cannot safely change what you cannot run and check.
Put a seam in front
Route all traffic through a thin proxy or front controller. Now you can send specific URLs to a new service while everything else still hits the old code.
Move one capability at a time
- Pick a bounded area — reporting, auth, a single module.
- Rebuild it in the new stack against the same database.
- Flip that route. Watch errors and latency. Keep the old path warm for a quick rollback.
Share the database, briefly
Both systems read and write the same tables during the transition. It is not elegant, but it means every step is small and reversible. Split the data last, once the new system owns a capability outright.
Users get a steadily improving app; the team never disappears for a quarter.