Legacy Application Modernisation: Strategies, Risks and a Plan

How to modernise legacy applications without a risky big-bang rewrite: the 7 Rs, portfolio assessment, the strangler fig pattern, data migration, cutover and where AI genuinely helps.

Legacy Application Modernisation: Strategies, Risks and a Plan: Sunday Labs

Legacy application modernisation means moving old systems onto architecture, platforms and practices that are cheaper to run and easier to change. The right approach differs per application: some should be rehosted, some refactored, some replaced and some retired. Most successful programmes modernise in small, reversible steps rather than one big rewrite.

That last point is the one people learn the hard way. Big-bang rewrites tend to run long, because the old system keeps changing while the new one is built and nobody fully understands what the old one does. This guide sets out how to decide what to do with each application, and how to do it without betting the business on a single cutover weekend.

Why modernise at all

Legacy is not a synonym for old. A ten-year-old system that is stable, secure and cheap to change is fine. An application becomes a modernisation candidate when it starts costing you in one of these ways:

  • Change is slow: small features take weeks because the code is tangled, poorly tested or understood by one person.
  • Running costs are high: licences, ageing hardware or manual operations eat budget that could go elsewhere.
  • Risk is rising: unsupported operating systems, runtimes or databases no longer get security patches.
  • Talent is scarce: few engineers want to work on the stack, and the ones who know it are close to retirement or leaving.
  • It blocks other work: data is locked in, integration is painful or it cannot support the AI and analytics plans the business has.

Be specific about which problem you are solving. It shapes every decision that follows.

The 7 Rs of legacy application modernisation

The "Rs" give you a shared vocabulary for the options. Different frameworks list six or seven; the table below uses seven.

Strategy What it means Effort Typical use
Retire Switch the application off Low Duplicate or little-used systems
Retain Leave it as it is for now None Stable systems with no pressing problem
Rehost Move to new infrastructure with no code change ("lift and shift") Low Exiting a data centre quickly
Replatform Move with small changes, such as a managed database or containers Low to medium Cutting operations work without a rewrite
Refactor Restructure code without changing behaviour Medium Healthy business logic in tangled code
Rearchitect Change the architecture, for example splitting into services High Systems that need to scale or change fast
Rebuild or replace Write it again, or buy a SaaS product instead High Commodity functions or code beyond repair

Some lists treat rebuild and replace separately and fold retain into "do nothing". The labels matter less than making a deliberate choice for each application.

A useful rule of thumb: the less differentiating a system is, the more you should lean towards replace or retire. Payroll, ticketing and document management rarely justify custom code. Your pricing engine or core lending workflow might.

Assessing the portfolio

Before choosing a strategy, take stock. For each application, capture:

  1. Business value: how important is it, and is it growing or shrinking?
  2. Technical health: code quality, test coverage, documentation, supportability of the stack.
  3. Cost: infrastructure, licences, support effort and the cost of change.
  4. Risk: security exposure, compliance obligations and key-person dependencies.
  5. Dependencies: which systems call it, which it calls, and what shares its database.

Plot applications on value against health. High value, poor health systems are your main modernisation candidates. Low value, poor health systems are candidates to retire or replace. High value, good health systems can usually be retained or replatformed cheaply.

Dependencies deserve extra attention. A shared database used by five applications is often the real constraint, and it decides your sequencing more than any single application does.

The strangler fig pattern

The strangler fig pattern is the safest way to modernise a large application you cannot switch off. You put a routing layer, such as an API gateway or proxy, in front of the old system. Then you build new functionality, or rebuild existing pieces, as separate components, and route traffic to them one capability at a time. Over time the new system grows around the old one until the old one can be removed.

The benefits are practical. Each step is small enough to test and roll back. The business sees value early instead of waiting a year for a rewrite. And you learn what the old system really does, one slice at a time, rather than discovering it all at cutover.

Good first slices are well-bounded, have clear inputs and outputs, and matter enough to show value. Avoid starting with the most tangled part of the system, however tempting it is to fix the worst pain first.

Data migration

Data is usually the hardest part. Code can be rewritten, but years of records with inconsistent formats, undocumented business rules and hidden dependencies need careful handling.

Plan for:

  • Profiling first: measure data quality, volumes and anomalies before designing the target schema.
  • Mapping rules: document how each field transforms, including defaults and edge cases, and get business owners to sign them off.
  • Incremental sync: use change data capture or dual writes so old and new systems stay consistent during the transition.
  • Reconciliation: compare record counts, totals and samples between systems automatically, not by eye.
  • Retention and compliance: decide what must move, what can be archived and what must be deleted under your data protection obligations. This is general information, not legal advice; check requirements for your sector and region.

Testing and cutover

Legacy systems rarely have good test coverage, so you need to build a safety net before changing behaviour. Characterisation tests capture what the system does today, including its quirks, so you can tell when the new version behaves differently. Our QA and test automation team often starts a modernisation by building this net.

For cutover, prefer techniques that limit blast radius:

  • Parallel running: send real traffic to both systems and compare outputs before switching.
  • Canary releases: move a small share of users or transactions first, then increase.
  • Feature flags: switch capabilities on and off without deploying.
  • Rollback plans: write them down, rehearse them and agree who decides to use them.

Managing risk

The common failure modes are well known. Scope grows as every stakeholder adds wishes to the rewrite. The old system keeps changing, so the target moves. Knowledge sits with a few people who are already overloaded. And the programme is measured on activity rather than outcomes.

Counter each one deliberately. Freeze scope to "same behaviour, better platform" for each slice, and handle new features separately. Agree how changes to the old system are mirrored. Pair legacy experts with the new team and record what they know. Measure progress by traffic moved, costs removed and change lead time, not by tickets closed.

Where AI helps in modernisation

AI tools are genuinely useful in modernisation work, as long as engineers stay in charge of decisions.

  • Code understanding: large language models can summarise unfamiliar modules, explain old languages and draft documentation, which speeds up discovery.
  • Dependency mapping: combined with static analysis, they help trace how data and calls flow through a large codebase.
  • Test generation: they can draft characterisation and unit tests, which engineers then review and correct.
  • Code translation: they can produce first drafts when moving between languages or frameworks, which still need careful review and testing.
  • Data mapping: they can suggest field mappings and flag likely anomalies for people to confirm.

What AI does not do is decide your architecture or guarantee correctness. Treat its output like a capable junior colleague's: helpful, fast and always reviewed.

A step-by-step modernisation plan

  1. Define the problem and the metric: cost, change speed, risk or capability, with one measure everyone agrees on.
  2. Assess the portfolio: score value, health, cost, risk and dependencies for each application.
  3. Choose a strategy per application: use the 7 Rs, and retire or replace wherever you can.
  4. Build the safety net: monitoring, characterisation tests and a working CI/CD pipeline.
  5. Pick a first slice: bounded, valuable and low risk.
  6. Put in the routing layer: so traffic can move gradually between old and new.
  7. Migrate data incrementally: with change data capture and automated reconciliation.
  8. Cut over gradually: parallel run, canary and rehearsed rollback.
  9. Decommission: switch off old components and remove their costs, or the savings never arrive.
  10. Repeat and review: measure against the agreed metric after each slice and adjust the plan.

Frequently asked questions

What is legacy application modernisation?

It is the process of updating old software so it is cheaper to run, safer and easier to change. Approaches range from moving it to new infrastructure unchanged, to refactoring or rearchitecting the code, to replacing it with a SaaS product or retiring it.

What are the 7 Rs of modernisation?

They are retire, retain, rehost, replatform, refactor, rearchitect and rebuild or replace. Each describes a different level of change and effort. Most portfolios use several of them, chosen application by application.

How long does legacy modernisation take?

It depends heavily on the size and complexity of the estate. A single application can be rehosted in weeks, while rearchitecting a core system is usually a programme of many months delivered in slices. Incremental approaches deliver value early, so the full timeline matters less.

Is it better to rewrite or refactor a legacy system?

Refactoring is usually safer when the business logic is sound and the problem is code quality or platform. Rewriting makes sense when the code is beyond repair or the requirements have changed fundamentally, but it carries more risk, so do it in slices using the strangler fig pattern.

Can AI modernise legacy code automatically?

Not reliably on its own. AI speeds up code understanding, documentation, test generation and first-draft translation, but engineers still need to review its output, make architectural decisions and verify behaviour with tests.

How Sunday Labs can help

Sunday Labs runs digital transformation and modernisation programmes that move legacy systems in small, reversible steps. Senior engineers assess your portfolio, build the testing safety net, run strangler fig migrations and handle data migration and cutover, with founders reviewing the work every week. Platforms stay agnostic and you own all the code. If a legacy system is slowing you down, start a conversation and we will help you decide what to modernise first.

Share LinkedIn X Email

Want this working in your business?

Talk to a founder, not a sales team. We reply within one business day.