The word "legacy" does a lot of damage. It suggests something outdated and therefore disposable. In practice a legacy system is usually the most load-bearing software in the organisation: it has absorbed fifteen years of regulatory changes, edge cases and customer-specific behaviour, most of which exist nowhere else — not in a specification, not in anyone's head, only in the code and in the data it has accumulated.
Modernisation projects that treat that system as an obstacle tend to fail. The ones that treat it as a constraint — something to be understood, decomposed and gradually relieved of responsibility — tend to finish.
Start with behaviour, not with code
The first instinct is usually to read the code and map the modules. That produces an accurate picture of how the system is built and a poor picture of what it does. What matters for a replacement is observable behaviour: inputs, outputs, side effects and timing.
The cheapest way to capture that is to record it. Put a proxy in front of the interfaces the system exposes, log requests and responses for a representative period — long enough to include month-end, if there is a month-end — and you have a behavioural specification derived from reality rather than from memory. It will contain surprises. It always does.
Cut along the seams the business already has
A monolith that has been running for a decade is not uniformly tangled. It has regions that change constantly and regions that have not been touched in years, and the boundary between them is usually a business boundary rather than a technical one.
Find those regions empirically. Version-control history will show which files change together and which never do; database access patterns will show which tables are read by one area and which are read by everything. The components that come out of this analysis are the ones that can be extracted with a knowable amount of work.
Extract the area with the highest change rate and the fewest data dependencies first. It delivers the most relief per unit of risk, and it teaches the team how the extraction pattern behaves before the stakes get high.
The strangler pattern, done honestly
Routing new work to a new implementation while the old one keeps running is a well-known approach, and it works — provided three things that are often skipped are actually done.
One source of truth per piece of data
The failure mode of an incremental migration is two systems that both believe they own the same record. Decide, per entity and per field, which side is authoritative for the duration of the transition, and make the other side read-only for that data. Bidirectional synchronisation between two writable systems is a class of problem that consumes entire projects.
A facade that both sides sit behind
Callers should not know which implementation served them. If they do, every migration step becomes a coordinated change across every consumer, and the project acquires exactly the coordination cost it was meant to remove.
A way back
Every cutover step needs a rehearsed reversal that does not depend on the new system being healthy. Feature-flagged routing gives you this cheaply:
const target = flags.claimsOnNewService(tenantId) ? next : legacy;
return target.submitClaim(payload);The flag is per tenant rather than global, so the first cutover affects one customer, and the reversal is a configuration change rather than a deployment.
Verify by comparison, not by testing alone
Tests written against the new implementation prove that it does what the author believed the old one did. That belief is the thing under suspicion.
Shadow running closes the gap: send production traffic to both implementations, serve the response from the old one, and compare. Differences are logged rather than raised, and the log becomes the work queue. Most of what it finds falls into three groups — genuine bugs in the new code, undocumented behaviour in the old code that turns out to matter, and undocumented behaviour that turns out to be a bug nobody noticed. The third group needs a business decision, not an engineering one, and finding it before cutover rather than after is most of the value.
Sequence around the business calendar
Every organisation has periods when change is unacceptable: a retail peak, a financial close, a regulatory filing window, an enrolment season. Map them before planning, then place each cutover in the quiet stretches and use the frozen periods for the work that carries no delivery risk — behavioural capture, test construction, shadow comparison, documentation.
This is not padding. A migration step that lands two weeks before a peak and turns out to be wrong will cost more than the whole project saved.
What "finished" should mean
A modernisation programme without a definition of done runs indefinitely, because there is always another component. Define completion in terms the business recognises: the legacy system no longer receives writes; a named list of integrations has been repointed; the change-cost measurement that justified the programme has moved.
Then decommission deliberately. A legacy system left running "just in case" keeps its licence costs, its security exposure and its ability to be quietly depended on again. Retiring it is the step that converts the work into a saving, and it is the step most often left undone.
