Skip to content
Back to BlogEngineering

A Staged Approach to Legacy System Modernization

TWOBLOX Editorial Team October 4, 2026
A Staged Approach to Legacy System Modernization

Legacy modernization projects fail in a remarkably consistent way. The team decides to rewrite the system, spends nine months building a replacement, discovers the old system contained business rules nobody knew about, and either ships something that is subtly wrong or does not ship at all.

The failure is not caused by bad engineering. It is caused by choosing a strategy whose first step is the largest and riskiest one.

Find the seam

A legacy system is rarely one thing. It is a collection of behaviours that happen to share a database and a deployment pipeline. The work begins with finding a boundary where you can route traffic to something new without touching the rest.

The pattern is well established: put a thin routing layer in front of the legacy system, move one capability behind it at a time, and retire the legacy path when the replacement has proven itself. Each step is independently shippable and independently reversible.

The hard part is not the routing. It is choosing the seams, because a good seam is one where the behaviour is coherent, the data is reasonably contained, and the business can tolerate a change in that area.

Start with read paths

Reads are dramatically safer than writes. A read path that returns a slightly different answer is a bug; a write path that does the wrong thing is an incident.

Start with a read-only capability, run it alongside the legacy system, and compare the outputs. This gives you something a test suite cannot: real production data flowing through both implementations, with differences you can investigate at leisure. The comparison harness is worth building even if it feels like overhead. It is the cheapest source of truth you will get.

Where AI genuinely helps

The interesting thing about applying AI to modernization work is how uneven the value is. It helps with specific, bounded tasks and gets in the way everywhere else.

It helps with:

  • Understanding undocumented logic. Extracting business rules from code nobody has read in a decade, and expressing them in a form a domain expert can review. The expert still decides whether the rule is correct; the model makes the rule visible.
  • Generating characterization tests. Producing tests that capture current behaviour, including the behaviour that looks like a bug. These tests are what make refactoring safe, and writing them by hand is slow enough that teams skip it.
  • Mapping fields between systems. The tedious correspondence work between an old schema and a new one, where the value is in the completeness of the mapping rather than the cleverness.
  • Drafting the unglamorous documentation. Migration notes, runbooks, and the explanations that never get written because the project is already behind.

It does not help with:

  • Deciding what the business rule should be. This is a judgment about the business, and it is exactly the thing that must not be inferred from what the code happens to do today.
  • Deciding the target architecture. A model can describe options. It cannot weigh them against your team's skills, budget, and constraints.
  • Assuming responsibility. Every extracted rule and generated test needs a named human owner. AI changes the volume of work, not where accountability sits.

Characterization tests before any change

Before touching a legacy behaviour, capture what it does today, including the parts that look accidental. If the system returns a value of zero in a particular edge case and customers have built processes around that, the zero is the specification.

This is unglamorous work and it is the difference between a modernization project that ships and one that argues about regressions for a year.

The migration ledger

Keep a single list of every capability, its current home, its target home, its status, and its owner. Modernization work spans quarters, and team members change. A ledger turns "are we nearly done?" from a conversation into a lookup.

When to stop modernizing

Not every legacy system should be migrated. Some are stable, rarely changed, and carry little risk. Modernizing them costs money and introduces risk in exchange for architectural tidiness.

The useful test is change frequency against risk. Systems that change often and carry consequential data are worth migrating. Systems that have not changed in three years and are not blocking anything are worth leaving alone, documented, and monitored.

Knowing which is which is the whole decision, and it is better made per capability than for the estate as a whole.

Ready to put these insights to work?

Talk to our team about your AI project and how we can help you move from strategy to production.