Legacy system: incremental modernisation or rewrite? A decision framework based on evidence, boundaries, testing, and migration, not taste.
A legacy system no one can leave alone makes every person who touches it ask the same question: modernise incrementally, or start over? The answer is rarely binary. Modernisation covers a broad spectrum from small changes to large migrations; a rewrite is a new project that does not inherit the same constraints. Choosing wrong doubles cost or loses what the old system quietly did.
The dangerous assumption is that rewrite means cleaner. Legacy systems hide business rules accumulated over years in code, data, and user habits. A rewrite removes the cruft, but also what no one noticed. This article offers a decision framework, not taste: evidence, boundaries, testing, migration. See rescue a failed software project.
What makes legacy a burden
Old is not a burden. The burden is real when rising change cost, knowledge loss, failing or absent tests, security, performance decay, hiring and training barriers, and dead dependencies combine. Measure these; do not assume them.
Evidence for incremental modernisation exists or can be gathered: clear change cost, testability, clear boundaries, a team that knows the system. What blocks incremental work is missing tests, missing boundaries, missing ownership.
Incremental modernisation
Incremental modernisation improves parts while the system keeps working. It includes upgrading dependencies, improving security, improving performance, clarifying boundaries, adding tests, extracting services, migrating a database gradually, and reducing technical debt. Each small change is reversible and measurable. It need not stop the system.
The core principle is strangling: replace gradually until the new replaces the old without downtime. Do not start what you cannot test. First add tests for what must not change, then modify.
Rewrite
A rewrite builds a new system instead of the old. It helps when architecture cannot work, technology is unsupported, total cost of modernisation exceeds a clean rebuild, and requirements differ fundamentally. But it surfaces every hidden rule, takes long, costs high, and risks never reaching production. See build vs buy.
Successful rewrite carries a strict bar: the old is replaced only by something proven no worse. Require parallel testing, a considered migration, dual-run period, and exit plan. Without this, rewrite renames risk rather than removing it.
Decision framework
Ask in order: what is the real pain? Is the problem code, process, data, or ownership? Is the system testable? Are boundaries clear? Cost of incremental vs rewrite? Capacity available? Risk to production? Many failed rewrites solve a problem that process or data would have solved. See technical due diligence.
Hybrid is common: modernise critical parts, secure data, reduce debt, and rewrite only one poorly-bounded component. This combines protecting what works with cleaning what blocks. Do not rewrite everything or update everything.
A short decision table:
| Indicator | Incremental | Rewrite |
|---|---|---|
| Core architecture | Salvageable | Cannot work |
| Testability | Present or buildable | Built from scratch |
| Hidden rules | Preserved gradually | Rediscovered |
| Production risk | Low | High |
| Cost | Bounded increments | High up front |
| Duration | Incremental | Long |
What must survive
The most valuable part of a legacy system is not the code but the business rules people know and documents do not. Why is a request rejected in one case? Why is a balance calculated in this order? A rewrite that does not extract these rules rebuilds the same mistakes in a newer style.
From reading to shipping
Want this built, not just explained?
Bring us the problem behind the article. We will tell you what it takes, what it costs, and whether we are the right team.
Data is part of the system, not a file to move. History, audit, and regulatory evidence may be requirements you cannot recreate. Ask: what must remain queryable in ten years? If the answer is clear, you have found a design constraint.
Integrations and the reports people depend on are often forgotten. A new system that does not match the old outputs creates unexpected manual work, and it appears after launch where fixing it costs most. Inventory them before the decision, not after.
That is why incremental modernisation is lower risk in many cases: move one part, verify, then move to the next. The strangler pattern lets both systems run together during the transition, so each step carries a smaller bet. See data migration and migration services.
Decision checklist
Name the real pain: code, process, data, or ownership.
Measure change cost before deciding.
Keep or add tests before changing.
Clarify boundaries before modernising or rewriting.
Extract hidden rules from code and data.
Choose incremental unless rewrite is proven cheaper.
Rewrite only if no worse, proven by tests.
Considered migration with dual-run and exit plan.
Check capacity, not ambition.
Hybrid modernise critical, rewrite only weak.
FAQ
Is rewrite always wrong? No. Starting without evidence is wrong. Rewrite is right when architecture cannot work, requirements differ fundamentally, capacity exists, and parallel testing is possible.
Is incremental slower? It may seem slower at first, but it keeps production working and reduces risk. Rewrite may stop delivering value for a long time.
What are hidden rules? Business rules accumulated in code, data, and user habits that were never written. Test current behaviour before changing it.
What if there are no tests? Add characterization tests for what must not change before any modification, modernising or rewriting.
How do I decide? With evidence: change cost, testability, boundaries, capacity, production risk. Not taste or a new label.
Is a rewrite always faster? No. It looks faster at first because it ignores hidden rules. You discover them later, so the schedule slips. Incremental modernisation surfaces complexity early, when it is cheaper to handle.
How do we handle undocumented business rules? Extract them through interviews, case tests, and output comparison between the two systems. Document them as acceptance criteria before coding, not after.
Do we need to rewrite everything at once? No. You can split the system into domains and move one at a time. Good splitting follows business boundaries, not code boundaries, so each part stays deliverable and verifiable.
When is a rewrite the right call? When the platform itself cannot be supported, or the rules are known and documented, or running it costs more than the alternative. The decision needs evidence, not frustration.
Can we modernise without downtime? Usually yes, incrementally. Both systems run together, and one path moves at a time. A full stop remains for systems that cannot tolerate dual running.
Sources
Cover image: Tyler, Unsplash License, via Unsplash.

