Put a layer in front of the old system that can send each request, user or process to either the old system or the new one. Then move one piece of work at a time, and switch each old piece off once its replacement is in use. The old system keeps running until the last piece has moved, so no single weekend decides whether the business can operate. The hard parts are the data both systems need during the transition and finishing what you started.
Engineers call this the strangler fig approach. Martin Fowler named it after a fig that grows around a host tree until it can stand without it, and Microsoft documents it as the Strangler Fig pattern.
Check that a gradual replacement fits this system
A gradual replacement is more work in total than a single cutover that goes well. For a period you run two systems, and you write code whose only job is to let them coexist. Fowler’s argument is that the lower risk and the earlier value outweigh the cost of that temporary code. That holds when the system is large, the business cannot stop, and nobody can list everything the old system does.
Microsoft’s page lists the cases where the approach may not suit:
- Requests to the old system cannot be intercepted.
- You cannot change the old system: there is no source code and no other way in, such as its database.
- The system is small and replacing all of it is simple.
- The old system has to be gone quickly.
Whether the system should be replaced at all is a separate question. Our guide to legacy system modernization covers it.
Decide what the pieces are
A piece is something a person can finish a task in: enter an order, approve an invoice, run the month-end report. Cut along the work people do. The old system’s internal modules rarely line up with it. The common ways to cut are these.
- By function. Quoting moves, then order entry, then invoicing.
- By group of users. One location, one department or one set of customers moves, then the next.
- By reading and writing. Reports and look-up screens move first, while the old system keeps recording the transactions.
Make the list with the people who use the system, by walking through their day. For each piece, note what data it reads and what data it changes. Mark what nobody uses and leave it out. Fowler makes the point that much of what an old system does is no longer wanted.
Put a routing layer in front
For a web application or an API, the layer is a proxy that sends each address to the old system or the new one. Users keep one address and one sign-in. For a desktop application, it may be a menu that opens the new screens in a browser, or a rule about which group uses which system. For integrations, it is the one place other systems send their data, which forwards it to whichever side owns that piece now.
Keep the layer thin. Microsoft’s page warns that it has to keep up with the migration, and that it must not become a single point of failure or a bottleneck.
Choose the first piece
Pick one that is small enough to finish, used often enough that people will notice, and that changes little of the data other parts depend on. Its real job is to prove that routing, sign-in, deployment and access to the old data all work with real users. The hardest part of the system is a poor first piece, and so is one that nobody would miss.
Settle where the data lives during the transition
This is most of the difficulty. The rule is that each piece of data has one system that owns it at any moment. Microsoft’s example moves the data in three stages, and the order is worth copying.
- The new piece uses the old database. It reads and writes the same tables, directly or through the old system. No data moves, and going back means changing a routing rule.
- The new piece gets its own tables. History is copied across, a sync keeps the two sets in step, and the two are checked against each other before the switch. A daily comparison of counts and totals, with the differences investigated, is a practical way to do that.
- The new tables become the record. Once the comparison has been clean for long enough to trust, the old tables for that piece are removed.
Going back is cheap until the old tables are removed and expensive afterward, so treat that removal as a decision somebody signs.
Move each piece with a way back
- Run the new piece beside the old one on real data, and compare the results wherever a result can be compared: an invoice total, a schedule, a calculated price.
- Switch a small group of users first, then the rest.
- Keep the routing rule reversible for an agreed period.
- Agree beforehand what finished means. A piece is finished when the old screen is switched off, access to it is removed and its jobs are disabled.
Keep the old system working while it shrinks
The old system still runs the business. Security updates, backups and fixes for real problems continue. New features stop: a request either goes into the new system or waits.
Mistakes that stall a gradual replacement
- Stopping when the easy pieces are done. The company then runs two systems indefinitely and pays for both. Keep the list of remaining pieces in front of the people who fund the work.
- Rebuilding everything the old system does. Find out what is used first.
- Letting both systems change the same data. Reconciling it afterward takes longer than deciding the owner would have.
- Leaving temporary code in place. Every sync job and adapter needs an owner and a condition for its removal.
Common questions
Is a gradual replacement always safer than a single cutover? For a large system the business cannot stop, usually yes. It is not worth the extra work for a small system that can be replaced and tested in one go, and it is not possible when the old system can be neither changed nor intercepted.
Which piece should we move first? One that is small enough to finish, used often enough that people will notice, and that changes little of the data other parts depend on. Reports and look-up screens are common first pieces for that reason.
What happens to the data while both systems are live? Each piece of data has one system that owns it at any moment. The other system reads it from the owner or receives a copy. Two systems both accepting changes to the same record, with no rule for which one wins, is the situation to avoid.
How long do the old and new systems run side by side? Until the last piece has moved, which for a large system is often longer than anyone first planned. That is acceptable as long as every piece that has moved is switched off in the old system and the list of what remains keeps getting shorter.
Do we have to rebuild every feature the old system has? No. Find out which features are used before you rebuild them. An old system collects reports, screens and options nobody has opened in years, and a replacement is the time to leave them behind.
If nobody can say with confidence what the old system does or where its pieces divide, a System Evaluation gives you written findings and a prioritized plan for a fixed fee.