Modernizing a legacy system in place means changing it one piece at a time while it keeps running. Microsoft, AWS and the Software Engineering Institute (SEI) each describe that path as a way to lower the risk of replacing a system. A rewrite from scratch, switched on in one go, is the route all three call hard or risky for large or complex systems. This guide is for a CIO at a manufacturer whose homegrown planning system schedules production every shift but is increasingly difficult to change. It covers when each path fits, what the incremental approach costs, and the questions that decide it. That matters because the plant has to keep shipping to customers while its software changes.
Gnar's legacy application modernization page names the two ways Gnar does this work: "Legacy application modernization means fixing or replacing old software without shutting the business down. The Gnar Company does it two ways. We build new screens on top of the system you keep. Or we build a new system next to the old one and switch over piece by piece".
What is the difference between modernizing in place and a full rewrite?#
Modernizing in place keeps the system in production and changes or replaces it one piece at a time. A rewrite from scratch builds a replacement and moves everyone onto it, often on one date. As general advice, the choice is two decisions: keep the existing code or replace it, and switch over all at once or piece by piece.
Microsoft's Azure Architecture Center describes the gradual path: "Incrementally migrate a legacy system by gradually replacing specific pieces of functionality with new applications and services".
The table separates the two decisions into four routes. These are general descriptions of legacy application modernization routes. The middle two are the routes Gnar's service page names.
| Route | What happens to the existing code | How people switch over |
|---|---|---|
| Refactor in place | Kept, and cleaned up part by part | No switch, the same software improves |
| New screens on the system you keep | Kept underneath the new screens | Team by team, as screens are ready |
| Rebuild next to the old system | Replaced one part at a time | Each part moves when its replacement works |
| Rewrite with one cutover | Replaced all at once | Everyone moves on one date |
What does rewriting code mean?#
Rewriting code means developers create new code to do a job that existing code already does. Gnar's code migrations page defines the other option: "Refactoring means cleaning up code without changing what it does". A legacy system rewrite applies the first idea to all of it at once.
What is a legacy system?#
In plain terms, a legacy system is software the business still depends on that was built with older tools, designs and infrastructure. Microsoft's guide puts the problem this way: "As systems age, the development tools, hosting technology, and system architectures that they're built on can become obsolete". Gnar's code migrations page is shorter: "Legacy software means old software your business still runs on".
Age alone does not settle the decision. Ian Cartwright, Rob Horn and James Lewis are Technical Directors at Thoughtworks. In Patterns of Legacy Displacement, they write that "a system being built on old technology is not in of itself sufficient reason for replacement". They also write: "The need to retire an old system is a common reason for legacy modernization".
What is legacy migration?#
Legacy migration is the work of moving what a legacy application does, its code and its data, onto a new platform. The SEI report describes the incremental version: "Initially, the legacy system consists completely of legacy code. At the completion of each increment, the percentage of legacy code decreases while the percentage of modernized code increases. Eventually, the system is completely modernized".
Why does a legacy system rewrite from scratch go wrong?#
As general advice, a rewrite from scratch can throw away the knowledge built into the legacy code, and it has to copy behavior nobody fully wrote down. Joel Spolsky argued the first part in his April 6, 2000 essay Things You Should Never Do, Part I. It is one engineer's opinion, written about software products.
Writing about Netscape, he called the decision "the single worst strategic mistake that any software company can make: They decided to rewrite the code from scratch". "When you throw away code and start from scratch, you are throwing away all that knowledge. All those collected bug fixes".
He also warns that a new team repeats the old team's errors: "You're just going to make most of the old mistakes again, and introduce some new problems that weren't in the original version".
As general advice, a homegrown planning system holds the same kind of knowledge. An odd rule in the scheduling code may exist because of certain customers, one production line or one shift pattern. Those edge cases are existing business rules, and a rewrite means your developers have to find each one again.
Cartwright, Horn and Lewis describe one replacement program where "BAU delivery of business requirements continued against the existing systems while the new project teams delivered against a set of requirements agreed at the beginning of the replacement programme". BAU means business as usual.
What is the feature parity trap?#
The feature parity trap is the plan to replace a system's technology while copying everything the existing system does. Cartwright, Horn and Lewis describe it on their Feature Parity page and write: "In general this is a pattern that we don't recommend".
Their page says "people greatly underestimate the effort required" and that "even just defining the 'as is' scope can be a huge effort".
To copy a system, their page says you first create a specification of what it does. It lists what that will likely require, including user actions, batch processes, interfaces and integrations, core algorithms, reports and data, and archeology.
- User actions. "What are the user roles" and "what actions can they perform".
- Batch processes. "What batch jobs are defined in the system? When are they triggered".
- Interfaces and integrations. "What systems are integrated?" In other words, which systems it connects to and which systems depend on it.
- Core algorithms. "Well known business rules and calculations that need to be replicated".
- Reports and data. "What reports does the system create".
- Archeology. "It is through an 'archaeological process' that you learn that changing the data field Y on screen A results in value Z appearing on report C after batch job N runs".
In the page's logistics example, much of the copying effort went into package types the business planned to stop handling. "The business had hoped that the processes and hence software would be much simpler without these difficult edge cases".
How do tests protect the business logic in legacy code?#
Tests protect the business logic, edge cases included, by creating a record of what the existing system does before your developers replace it. The Feature Parity page says: "For core algorithms and core business logic, ensure that you have built a suite of unit tests around these parts of the existing system. These will provide executable specifications of the business logic / algorithm that is known to successfully run on the existing system".
The page also names business value: "Looking at the business value and making sure that is represented in any architectural decisions can often highlight issues with Feature Parity driven approaches".
Gnar's code migrations page says this about refactoring: "We do it when a part still does its job, and write tests as we go". Its service page adds: "The new code comes with tests and written notes, and you own it. The next change won’t depend on the one person who knows the old code".
When does modernizing legacy software in place make sense?#
Modernizing in place makes sense when the legacy system still does its job in production and the problem is how hard it is to change or use. Gnar's service page gives its first path this test: "Use this when the old system still works, we can reach its data, and the screens are the problem".
Martin Fowler's Strangler Fig page, dated 22 August 2024, describes the strangler fig, the gradual path Microsoft describes above, and what it needs. Breaking down a legacy system's structure "will involve identifying seams", places where it can be split. His footnote is blunt: "In a well-designed system, these seams would already exist. But such systems are unicorns".
Microsoft states the business case for working this way. "The goal of this approach is to maximize the use of existing investments in the currently running system while modernizing incrementally. It enables you to perform high-ROI replacements before low-ROI replacements". ROI here means return on investment.
When is a full rewrite the better call?#
As general advice, a rewrite from scratch is the better call in a narrow case: a small system with low refactoring complexity. A system that cannot be saved still needs new code, and Gnar's service page builds that new system next to the old one.
AWS Prescriptive Guidance says: "For small applications, where the complexity of complete refactoring is low, it might be more efficient to rewrite the application in microservices architecture instead of migrating it".
Does a rebuild have to be a big bang cutover?#
No, a rebuild can replace the code without moving everyone on one date. Gnar's second path builds a new system next to the old one, and "The old system keeps running until each part of the new one is ready". As general advice, treat these as two separate modernization choices: a rebuild decides what happens to the code, and the cutover plan decides when each team moves.
AWS calls an application a monolith when most of its functionality runs in a single process or container, with tightly coupled code. It describes the big bang version as "A big bang migration, where the monolith is migrated in a single operation", and says it brings risk and business disruption. The SEI's July 2001 report, Legacy System Modernization Strategies, is firmer: "making a single deployment of the modernized version is too risky to be admissible".
The AARP Foundation case study shows a replacement that kept the old tools running. It reads: "Some legacy systems can be saved. Others have to be replaced. The audit made the call clear: replatforming would cost less and carry less risk than rebuilding on top of the existing codebase".
The case study also says: "Just as important, the program couldn't go dark while we did it". So the plan kept the existing tools running while their replacements took shape. Its second phase was "Rebuild while maintaining", and 14 tools were rebuilt on React and Ruby on Rails.
Gnar's service page says: "Your team keeps using the old system while we build. If you’re replacing it, each part moves over only when its replacement works". Microsoft describes the goal for customers: "Customers continue to use the same interface and are unaware that a migration is in progress".
What is a parallel run?#
A parallel run keeps the legacy system working next to the new one, so users can fall back if the new part fails. The SEI report describes it: "the modernized system is put into operation, but the legacy system is maintained as a 'hot' backup. If the new system fails to function properly, control can be switched over to the legacy system".
It names a condition too: "for this approach to be feasible the legacy system must have access to the latest data".
What does incremental modernization cost that a full rewrite does not?#
Incremental modernization pays to create code that exists only during the change, and for repeating testing and release at every step. Fowler calls the first item transitional architecture, "code that will go away once the modernization is complete". The table lists the costs the sources name.
| Cost | What the source says | Source |
|---|---|---|
| Temporary code | "code that will go away once the modernization is complete" | Martin Fowler |
| Test and release for each step | Fixed costs "are incurred for each increment" | SEI, 2001 |
| A new design shaped like the old | Likely "to cause the target architecture to resemble the legacy architecture" | SEI, 2001 |
| The database changed more than once | It "may also result in multiple restructuring of the database" | SEI, 2001 |
| Extra infrastructure to run | It "adds an extra service that you must manage and maintain" | Microsoft |
| Data held in two places | "data redundancy and eventual consistency between two data stores" | AWS |
The extra layer in the Microsoft row is what Microsoft calls an anti-corruption layer: "Implement a facade or adapter layer between different subsystems that don't share the same semantics". Without one, Microsoft says, the new application "might need to support outdated infrastructure, protocols, data models, APIs".
The SEI report says a single increment "minimizes development and deployments costs" in theory. Then it adds: "In practice, a single development/deployment cycle does not always result in lower development costs because of the added complexity of completing the entire project at one time".
How do old and new systems share data while both run?#
As general advice, old and new systems share data during a modernization through a plan that says which system owns each set of records at each step. Microsoft's guide says: "Consider how to handle services and data stores that both the new system and the legacy system might use. Make sure that both systems can access these resources at the same time".
Its database example moves one service and its domain at a time, in three steps:
- The new service uses the old database. "The new system service still reads from and writes to the monolithic database for its domain tables. The legacy system continues to serve all other domains".
- A new database is filled and kept in sync. A bulk load copies the tables and their history. A change data capture (CDC) process keeps them in sync. "Validate consistency between both databases before cutover".
- The new database takes over. "After validation, the new domain database is the system of record for that domain". Then the old tables come out, and the process repeats for the next area.
Microsoft says you can roll back to the old database during step 2 and at the start of step 3. After the old tables are removed, rolling back "significantly increases effort and risk". Its advice: "Treat the removal of legacy objects as a deliberate final step for each domain".
Old systems can hide how their data moves. Of the system it studied, the SEI report says "there are many internal complications that make it more difficult to understand legacy data flows". Cartwright, Horn and Lewis give an example: "An example of the need for Archeology introduced itself shortly after testing the new implementation in production". Business critical management reports stopped matching. The team found that the old middleware's database was copied into the data warehouse, where batch jobs, stored procedures and views fed key business reports.
Gnar's service page says: "While old and new run side by side, we keep the data in sync between them".
Which questions decide in place or rebuild?#
Gnar's service page answers it: "Four things decide it: how the old system is built, how easy its data is to reach, whether whoever built it still supports it, and where your business is going". The questions below decide between keeping, rebuilding next to the existing system and a rewrite from scratch. Each row comes from the page named in its last column.
| Question | What a yes points toward | Source |
|---|---|---|
| Does the old system still work, can its data be reached, and are the screens the problem? | New screens on the system you keep | Gnar service page |
| Is the vendor forcing you off it, or can it not be saved? | A new system built next to the old one | Gnar service page |
| Is the system small, with low refactoring complexity? | A rewrite might be more efficient | AWS |
| Must a part match well known specifications exactly? | A like for like copy of that part | Feature Parity page |
Agree on the goal and the business case for the modernization before you use the table. Fowler writes: "we need to be crystal clear about our desired outcomes". As general advice, write each outcome down as a success measure the business can check after every step.
Writing about the system it studied, the SEI report treats the target architecture, the new architecture the modernization aims for, as something the first step should help create: "A desired artifact of Increment 1 development is to gain a greater understanding of the legacy system and to use this acquired knowledge to define the desired architecture of the future system".
Why does legacy modernization depend on the organization?#
Legacy modernization projects depend on the organization because the habits that produced the old system can shape the new one too. Fowler writes: "If there's no change in organizational culture and leadership, the new systems will end up in a similar mess".
Cartwright, Horn and Lewis put a number on their own observation: "technology is at most only 50% of the legacy problem, ways of working, organization structure and leadership are just as important to success".
How does Gnar choose a path for legacy application modernization?#
Gnar's modernization work starts with senior engineers reading the code your business runs on. Then it decides part by part whether to keep, fix or replace. The codebase audits page says: "We read the code before anyone talks about a rebuild". The audit is free: "No fee, and it can come back saying your codebase is in reasonable shape". The page says what it covers: "A Gnar code audit checks the code, how it is put together, and how it connects to your other systems. Senior engineers read it, and Gnar’s own AI tool checks it too".
The same page answers what happens when an audit points to a rebuild: "Then it says what to rebuild and what to keep. Take the AARP Foundation. The Gnar Company’s audit showed that a new platform would cost less than building on the old code. It also carried less risk. For First Line Technology, Gnar’s review said to keep the existing system. Gnar built a new app on top of it, which cost less than fixing the old app".
Gnar's earlier post on replatforming, refactoring or rebuilding ends its table of warning signs the same way: "Most real systems show more than one of these signs. That is why the decision is made part by part, after someone has read the code".
The paid step is Gnar Discovery and Design. Its page says: "The Gnar Company’s Discovery costs $20,000 to $30,000, depending on the tier. Core costs $20,000 for four weeks and Accelerator $30,000 for six weeks". The service page adds: "Builds usually run $150K to $300K+".
You may not need Gnar at all. Gnar says it plainly: "If your own team has the capacity and the direction, you do not need us".


