Working With Developers

Legacy System Modernisation: Rewrite, Refactor or Replace Gradually

Old systems are risky to keep and risky to change. This guide explains the modernisation options in plain terms, why full rewrites so often disappoint, and how to replace a system piece by piece while it stays in service.

By Rahul D SarkerPublished November 14, 2026Updated November 14, 20266 min read

Part of our Working With Developers series. Start with How to Choose a Software Development Agency: A Founder's Guide.

The Short Answer

What is the safest way to modernise a legacy system?

Replace it gradually. Put a layer in front of the old system, rebuild one function at a time on a modern platform, route users to each new part as it is ready, and retire the old system only when nothing depends on it. This is known as the strangler fig approach, and it avoids the long, high-risk gap of a full rewrite.

A legacy system is not simply an old one. It is a system the business depends on that has become hard to change, hard to staff or hard to secure. Many are also the most valuable software the company owns, because years of business rules live inside them.

28%Of central government systems in the UK were classed as legacy in 2024State of digital government review
45%Average budget overrun on large IT projectsMcKinsey and University of Oxford
76% vs 10%Success rate of small projects against very large onesStandish Group, CHAOS 2013

How to Tell It Is Time

  • Changes take months. Small requests are quoted in weeks and delivered late.
  • Only one or two people can work on it. Or the supplier who built it has gone.
  • The technology is out of support. No security updates for the language, framework, database or operating system.
  • It cannot connect. No API, so new tools need manual exports.
  • Running costs are rising. Specialist hosting, licences and contractor day rates.
  • It blocks the business. A product, market or partnership is waiting on it.

If you are unsure how serious the position is, commission an assessment first. Our guide to technical due diligence describes what a review covers.

The Six Options

Modernisation options, from least to most change
OptionWhat it meansUse when
RetainLeave it, with better monitoring and documentationIt works, changes rarely, and risk is contained
RehostMove it to modern infrastructure unchangedHardware or hosting is the problem, not the software
ReplatformUpgrade the database, runtime or framework versionThe code is sound but its foundations are out of support
RefactorRestructure the code without changing what it doesThe design is hard to change but the logic is right
Replace graduallyRebuild function by function alongside the old systemThe system is critical and too large to replace safely at once
Replace with a productBuy an off-the-shelf systemThe process is standard and products now cover it

These are not exclusive. A common plan rehosts first to remove immediate hosting risk, then replaces gradually. For the last option, see custom software vs off-the-shelf.

Why Full Rewrites Disappoint

The instinct is to start again with a clean design. It is rarely the best route, for four reasons.

  • Hidden rules. The old system encodes years of exceptions nobody remembers. A rewrite rediscovers them one bug at a time.
  • A moving target. The business keeps changing while the new system is built, so the specification is out of date before launch.
  • No value until the end. Money is spent for a year or more before anyone benefits.
  • Size. Large projects fail far more often than small ones, as the Standish Group and McKinsey figures above show.

A rewrite can still be right for a small system, or where the technology is so obsolete that nothing can be reused. For anything large and business-critical, prefer gradual replacement.

Gradual Replacement, Step by Step

Martin Fowler named the strangler fig pattern after a plant that grows around a tree until it can stand on its own. Applied to software, it works like this.

  1. 1

    Map what the system does

    List its functions, users, data and connections. Record how often each part is used.

  2. 2

    Put a routing layer in front

    A gateway through which every request passes, so traffic can be sent to old or new parts without users noticing.

  3. 3

    Choose the first slice

    Something valuable but contained: a report, a customer-facing page, one workflow.

  4. 4

    Build the slice on the new platform

    With automated tests that compare its results with the old system.

  5. 5

    Keep the data in step

    Synchronise old and new databases while both are live. This is the hardest engineering in the project; plan for it.

  6. 6

    Switch the slice over

    Route a small share of users first, then everyone.

  7. 7

    Repeat

    Each slice delivers value and reduces what remains.

  8. 8

    Decommission

    When nothing calls the old system, archive its data and switch it off.

Data Is the Hard Part

Code can be rewritten. Data has to be carried across intact. Before any slice goes live, agree which system is the master for each kind of record, how changes flow between the two, and how you will prove nothing was lost. Reconcile counts and totals daily during the transition. Keep a tested way to roll a slice back.

Building the Business Case

What to put in a modernisation business case
ElementQuestion it answers
Cost of doing nothingWhat do support, contractors, workarounds and incidents cost each year, and what is the exposure if it fails?
Opportunities blockedWhat revenue or savings are waiting on the change?
Phased investmentWhat does each slice cost, and what does it deliver?
Risk reductionWhich security, compliance or key-person risks does each phase remove?
Stop pointsWhere could the programme pause and still leave the business better off?

Funding by slice keeps the commitment small and the evidence fresh. It is the same principle as building an MVP; see MVP development for established companies.

Mistakes to Avoid

  • Copying the old system screen for screen. You rebuild its faults. Ask what each function is for.
  • Modernising everything. Parts that work and rarely change can stay.
  • Freezing the business for the duration. Urgent changes will be needed; plan how they reach both systems.
  • No retirement date for the old system. Running two systems indefinitely costs more than either.
  • Losing the people who know it. Involve them early. Their knowledge is the specification.

If you are responsible for a system like this and want an outside view on the options, tell us what it does and what it runs on.

Frequently Asked Questions

What is a legacy system?

A system the business depends on that has become difficult to change, support or secure, usually because of outdated technology, missing documentation or a shortage of people who understand it.

Should we rewrite our legacy system from scratch?

Rarely for a large, critical system. Full rewrites take long, deliver no value until the end and tend to miss rules hidden in the old code. Gradual replacement is usually safer.

What is the strangler fig pattern?

A way of replacing a system in pieces. New functions are built alongside the old system and traffic is routed to them one at a time until the old system can be switched off.

How long does legacy modernisation take?

It depends on the size of the system. With gradual replacement, the first slice can be live within a few months, and the programme continues slice by slice, delivering value throughout.

How much does it cost to modernise a legacy system?

Cost follows scope. Price it by slice, and compare each slice with the yearly cost and risk of leaving that part as it is.

Can we modernise without downtime?

Largely, yes. Running old and new parts side by side behind a routing layer lets you switch users gradually and roll back if a problem appears.

Have a build brief already forming in your head?

Loomstrat Studio scopes, builds, and hands over production software in 3–6 weeks - fixed price, 100% repository ownership.

  • Reply within 24 hours
  • Fixed price before we start
  • Zero technical debt guarantee