Most legacy systems are old because they work. They also carry years of business rules nobody wrote down. The fastest way to lose those rules is to switch the old system off and a new one on in a single weekend. These ten techniques are how I would approach a migration instead.
1. Start with an honest inventory
List every screen, service, scheduled job, integration and report, and find out which ones people actually use. Usage data often shows that a large part of an old system can simply be retired rather than migrated.
2. Pin down current behaviour with characterisation tests
Before changing anything, write tests that record what the system does today, including its odd edge cases. They become your safety net: if the new version gives a different answer, you find out before your customers do.
3. Use the strangler fig pattern
Build the new system around the old one and move features across one at a time, until the old system has nothing left to do. At every step you have a working product, and you can stop or change direction without writing off the whole budget.
4. Route traffic through a proxy or gateway
A reverse proxy or API gateway in front of both systems decides, route by route, which one handles each request. Moving a feature becomes a configuration change, and so does rolling it back.
5. Branch by abstraction
Inside the code, put an interface in front of the part you want to replace. Point it at the old implementation, build the new one behind the same interface, then switch over. No long-lived branches, no painful merge at the end.
6. Protect the new system with an anti-corruption layer
Old systems often have confusing data models. A translation layer between old and new stops those quirks leaking into the clean design you are building.
7. Change the database in small, reversible steps
Use expand and contract: add the new structure alongside the old, write to both, migrate the data, move readers across, then remove the old structure. Change data capture can keep two databases in sync during the move.
8. Run old and new in parallel and compare
For calculations, pricing, payroll or anything where a wrong answer is expensive, run both systems on the same inputs and compare the outputs before you trust the new one.
9. Release behind feature flags and to small groups first
Turn new features on for internal staff, then a small group of users, then everyone. If something goes wrong, switch it off in seconds instead of redeploying.
10. Use AI to read, map and refactor, with a human in charge
AI coding tools are now very good at explaining unfamiliar code, mapping dependencies and doing repetitive refactoring across large codebases. I use Claude Code and Codex this way every day. The rule is simple: AI does the heavy lifting, tests prove the behaviour, and an experienced engineer reviews every change.
Pick the right strategy for each part
Not everything needs the same treatment. A common framework, often called the "Rs" of migration, sorts each part of the estate into:
- Retire: nobody uses it, switch it off.
- Retain: leave it for now, on purpose.
- Rehost: move it to new infrastructure as it is.
- Replatform: small changes to run on a modern platform.
- Refactor or rearchitect: change the code to fix real limits.
- Replace: buy a product and migrate the data.
Running an old .NET app? See my guide to options for legacy .NET apps after .NET 8 end of support.
Questions people ask
Should we rewrite our legacy system from scratch?
Rarely in one go. A phased migration using the strangler fig pattern keeps the business running and lets you stop or adjust at any point.
How do we avoid losing business rules during a migration?
Write characterisation tests that record current behaviour first, and run old and new systems in parallel for anything where a wrong answer is costly.