Start a project

Insights · Enterprise Technology · Playbook

Modernizing Legacy Systems Without Stopping the Business

By iVirtualSoft Editorial

Illustration of a bridge linking aging server cabinets to a modern building connected to the cloud

Most organizations with a system too important to switch off and too old to change easily feel the same temptation: rewrite it all and cut over in one weekend. For most systems, that is the riskiest option on the table. Replace it in small pieces instead, while it keeps running: put a routing layer in front, move one capability at a time, prove each new piece matches the old, and only then switch the old one off. AI can speed up the understanding and testing work. It cannot tell you what your business rules are meant to be.

The strangler fig pattern, briefly

Modernizing without stopping the business rules out a big-bang cutover. Customers, staff and partners keep using the same entry points while the system behind them changes. The standard approach is called the strangler fig pattern: build new functionality alongside the old system and move behavior over gradually, until the old system has nothing left to do and can be retired.

The name comes from Martin Fowler, who saw strangler figs in Queensland's rain forests in 2001. These vines grow around a host tree and eventually replace it. His argument against the alternative is practical: a full rewrite takes a long time, users cannot wait for new features in the meantime, and much of the legacy behavior is not worth copying anyway.

Microsoft's Azure Architecture Center describes the mechanism. A facade (a proxy that sits in front of the legacy system) intercepts requests and routes each one to either the old system or the new one. Over time the facade sends more traffic to the new system. When nothing depends on the old one, you decommission it, and usually remove the facade too.

The approach has a cost worth stating plainly: you will build and run transitional architecture that you later throw away. Fowler accepts that trade. Our view is that the reduced risk and earlier value usually justify it, though not in the cases below.

When is the strangler approach the wrong choice?

Use the pattern when the old system can keep running for a long time and you can intercept requests to it. Do not force it when:

  • Requests cannot be intercepted, or you cannot change the legacy system or its database at all. Microsoft lists both as reasons the pattern may not fit.
  • The system is small and replacing it outright is simple.
  • You need to switch off the original quickly.

AWS Prescriptive Guidance lists two of the same caveats (small, simple systems and requests that cannot be intercepted) and, like Microsoft, warns that the proxy can become a single point of failure or a bottleneck if it is not designed properly. Treat the facade as production software with its own availability target.

Five phases, each with an exit test

Each phase has an exit criterion. Do not start the next phase until the current one meets it. This is how you keep "incremental" from turning into "never finished".

Phase 1: Assess

Build an inventory before you design anything. List every system, interface, scheduled job, report and data store. Record who depends on each one and what breaks if it stops. Then rank by risk and by value, not by age.

Look hardest for hidden coupling: shared databases, files dropped in folders, batch jobs that other teams quietly rely on. Anthropic's modernization article calls out hidden dependencies as exactly what makes legacy modernization risky. Note that this is vendor content, and its claims are not backed by published data.

Exit criterion: a written inventory with owners, a dependency map reviewed by the people who run the system, and agreement on the outcome you want. Fowler stresses aligning on outcomes early because different groups often want different things.

Phase 2: Choose a seam

A seam is a place where you can split the system with little damage: an interface, a workflow, a data domain. Legacy systems are rarely modular, so seams must be found, not assumed. Fowler's advice is to replace small components first. Small replacements limit risk, deliver value sooner and teach you how to replace the rest.

Pick the first seam by three tests: it is relatively isolated, the business can verify its output, and a failure is survivable. Avoid starting with the most central, most tangled part because it feels most valuable.

Exit criterion: one chosen seam, a defined interface for it, a rollback plan, and a named person who owns the business rules in that area.

Phase 3: Strangle and replace

Install the facade, then build the replacement behind it. Two design points matter here.

First, decide how both systems share data during the transition. Microsoft's guidance is to make sure both can access shared stores at the same time. For a shared database, it describes a staged path: copy the domain's data to its own database, keep it in sync with change data capture (reading the database's change log), validate consistency, and only then make the new database the system of record.

Second, protect the new design from the old one. Where old and new must talk to each other, use an anti-corruption layer: an adapter that translates between the two systems so the new system does not inherit legacy data models and quirks. The Azure pattern page notes the costs: added latency and one more service to run. It also advises keeping the layer to translation only, with no business rules in it.

Exit criterion: the new component handles the seam's traffic in a test environment, its contract with the facade is documented, and monitoring is in place before any real traffic moves.

Phase 4: Run in parallel and compare

This is the phase that protects the business. Send real requests to both systems, serve the answer from the old one, and compare the new one's answer in the background. Then shift a small share of live traffic to the new system, widen it in steps, and keep the old path warm for rollback. The AWS guidance requires a rollback plan for each refactored service, and Microsoft notes that rollback gets expensive once legacy data objects are removed. So make removal a deliberate last step, taken only after validation.

Define "matches" before you start. Exact equality is often the wrong test. Rounding, ordering, timestamps and error messages may legitimately differ. Agree with the business owner which differences matter.

Exit criterion: differences between old and new are explained and accepted, the new path has carried full production load for an agreed period, and the rollback path has been exercised at least once.

Phase 5: Decommission

Switch off the old capability, remove its data, and delete the transitional code. Skipping this phase is how organizations end up running two systems indefinitely. Microsoft's pattern ends with removing the facade, or keeping it deliberately as an adapter for legacy clients you cannot update.

Exit criterion: no traffic, jobs or reports touch the old component; its data is archived or migrated; the cost of running it has stopped. Then return to Phase 2 for the next seam.

AI earns its keep on understanding and verification

Three places, all before and around the code change itself.

Code comprehension. Models can read unfamiliar code, trace execution paths and map dependencies faster than a person reading it cold. In a July 2025 post on Microsoft's developer blog, Microsoft engineers describe agents that analyze program structure and map copybook and program dependencies in COBOL, producing diagrams for human engineers. This is also vendor content, written with one customer, and it publishes no accuracy, cost or time figures. Anthropic's article makes a similar claim about tracing paths and surfacing coupling.

Test generation. AI can draft characterization tests, which record what the existing system does today so you can check the new one against it. Anthropic describes AI drafting preliminary tests to check migrated code against legacy output. Microsoft reports that deterministic controls, especially tests, were crucial for verifying agent output.

Documentation. Many legacy systems have none that is current. Generated descriptions and diagrams give reviewers something to correct, which is faster than writing from nothing.

Where AI falls short

AI cannot decide what the business rules should be. Code shows what a system does, not what it was supposed to do. Some behavior is a bug that customers now depend on. Some is a regulatory requirement nobody wrote down. Anthropic's own article says engineers supply knowledge of regulatory requirements and business priorities that AI lacks, and that your team decides whether AI-drafted tests are sufficient.

Generated code must be verified like any other code. Microsoft's write-up reports that agents lost coherence and hallucinated when given too much context, and that not all COBOL is equally migratable: some modules depend on mainframe batch throughput, I/O, JCL job orchestration and strict service levels, and may need redesign rather than translation.

The rule we would apply: use AI to draft understanding, tests and first-pass code, and use deterministic checks and named humans to accept them. Nothing generated reaches production without a test that fails when the behavior is wrong. This matches the human-approval and evaluate-before-release practices described on our Enterprise AI page.

Commit to one seam, not a roadmap

Do not commit to a full roadmap yet. Commit to Phases 1 and 2 and one pass through Phases 3 and 4 on a single low-risk seam. If that pass ends with explained differences, a working rollback and a switched-off component, you have evidence the approach fits your system and your team. If it does not, you learned that cheaply, before the expensive decisions.

Related reading: what it takes to build AI agents that work covers the same verify-before-trust discipline for AI that acts on your systems.

Our Enterprise AI page outlines the same Assess, Plan, Replace approach to integration and modernization. If you are weighing a first seam in a system that cannot go down, you can describe the system to us here.

References

  1. Strangler Fig Application (Martin Fowler)
  2. Strangler Fig pattern (Azure Architecture Center, Microsoft Learn)
  3. Anti-corruption Layer pattern (Azure Architecture Center, Microsoft Learn)
  4. Strangler fig pattern (AWS Prescriptive Guidance)
  5. How We Use AI Agents for COBOL Migration and Mainframe Modernization (Microsoft, July 2025)
  6. COBOL Modernization with AI: Breaking the Cost Barrier (Anthropic, February 2026)

Written and reviewed under our editorial standards. Spotted an error? Email info@ivirtualsoft.com.

What should we build together?

Tell us what you’re trying to build, improve or replace. We’ll help shape it into a scoped brief before anyone commits to anything.