Legacy System Modernization with AI, Without Downtime
Ricardo Argüello, February 10, 2026
Inherit a fifteen-year-old ERP and the first big cost shows up before anyone writes a line. Reading it.
The person who wrote the commissions logic left in 2017. The docs describe a version of the system that stopped existing years ago. Billing is the module nobody touches, because the last person who did took down month-end close. It all works, mostly, and nobody can tell you why.
That reading problem is where AI earns its keep in a modernization. It won’t write your new system. It will do in weeks the part that used to eat half the budget. In our AI-assisted legacy modernization service, that reading is the first month of work.
What AI actually does in a legacy project
Two public numbers are worth knowing before you talk to any vendor, me included.
Morgan Stanley built an internal tool called DevGen.AI and pointed it at its old code starting in January 2025. By June it had gone through 9 million lines of COBOL and Perl and produced plain-English specifications, saving an estimated 280,000 developer hours, according to what Mike Pizzi, the bank’s global head of technology and operations, told the Wall Street Journal. It doesn’t rewrite anything, by design. It extracts the business logic, and engineers rebuild from the spec.
Amazon went the other direction and let AI change the code. Andy Jassy wrote that upgrading an application to Java 17 dropped from about 50 developer-days to a few hours with Amazon Q, that they moved more than half their production Java systems in under six months, and that the savings came to 4,500 developer-years. Keep in mind that’s Java to newer Java. Crossing languages, say Visual FoxPro to Python, is harder and needs a lot more human review.
The third job is the one I care about most. Characterization tests. Before you change a module, you want tests that capture what it does today, bugs included, so you can prove the replacement does the same thing. Writing those by hand against undocumented code used to take forever. Now a model drafts them from the source and your team reviews them.
Anthropic laid out that same sequence for COBOL in February: map dependencies, document, score risk per component, and only then translate. We wrote about the market reaction when IBM lost $31 billion that day.
The five strategies still apply. Their price tags moved.
- API wrapping puts a modern interface in front of the old system. It was already the cheap option, and AI doesn’t change much here.
- Re-platforming (lift and shift) moves the system to the cloud as-is. Version upgrades, the boring part, become close to routine.
- Refactoring cleans up the code without changing behavior. Characterization tests are what make it safe, and those are now cheap.
- Re-architecting splits the monolith. The dependency map stops being guesswork.
- Rebuilding from scratch now starts from specs extracted from the code instead of from someone’s memory.
I’d still argue against the full rebuild for almost any mid-sized company. AI makes it cheaper. It doesn’t make a single launch day less risky.
COBOL, RPG, FoxPro, Delphi: the language changes the plan
“Legacy system” tells you little until you know what it’s written in.
- COBOL lives on the mainframes of banks, insurers and governments. It has the most tooling and the most public examples, Morgan Stanley’s among them.
- RPG runs on IBM i, which plenty of people still call the AS/400, and keeps distributors, factories and retailers running. The logic tends to be split between RPG programs and the DB2 database on the same box.
- Visual FoxPro sits behind a lot of desktop ERPs at mid-sized companies. Microsoft ended support in January 2015, and the data still lives in DBF files.
- Pascal and Delphi stayed in client-server applications, with business rules buried in each form’s event handlers. Embarcadero still sells Delphi, so sometimes upgrading beats rewriting.
- Visual Basic 6, PowerBuilder, Clipper and Progress 4GL show up with the same problem: logic glued to the screen.
That matters for AI in two ways. There is far more public COBOL and Java than RPG or FoxPro, so with the less common languages expect more model mistakes and more review hours. And when a rule lives inside a button on a form, pulling it apart from the interface is half the work of understanding it.
You don’t always have to migrate the core. For Repuestos COYBO we built a FastAPI layer that reads their Visual FoxPro ERP and feeds live prices and stock to their online store, with no catalog migration. That’s the API wrapping option above, and it’s often the right first step.
A month-by-month plan
This is how we structure the work at IQ Source, using the Strangler Fig pattern, where the new system grows around the old one and replaces it piece by piece.
| When | What happens | What you have at the end |
|---|---|---|
| Month 1 | Module inventory, dependency map, AI-generated docs reviewed with the people who use the system daily | A ranked list of modules by pain and by isolation |
| Month 2 | Characterization tests on the first module, an API layer in front of it | A module you can replace safely, with nothing switched off yet |
| Months 3-4 | The new version runs in parallel and gets compared against the old one | First module in production, traffic redirected |
| Month 5 on | Next modules reuse the map, the tests and the API layer | The old system shrinking, one piece at a time |
Which module goes first, the one that breaks most or the one with the fewest dependencies? Who confirms that a weird rule is a bug and not a policy someone asked for in 2014? Do you trust the data enough to move it? Those get answered in month one, by people.
Where AI stops helping
AI tells you what the code does. Whether it should keep doing it is a different question, and only someone from operations can answer it.
Data migration is the other place I’d expect the schedule to slip. Old data carries twenty years of exceptions stuffed into free-text fields, and no model knows which of them still matter.
And keep the team that has maintained the old system in the room. They know where the traps are. Cut them out and you end up with beautifully documented code and none of the context.
If there’s a system in your company nobody wants to touch, put a number on what it costs you first. Our technical debt calculator gets you one, and the full approach is on our legacy modernization page.
Frequently Asked Questions
How is AI used in legacy system modernization?
In legacy system modernization, AI reads old code and turns it into documentation and specifications, maps dependencies between modules, generates characterization tests that pin down current behavior, and translates or upgrades code. Morgan Stanley used it on 9 million lines of COBOL and Perl. Business decisions about what to keep remain human.
How much does legacy system modernization cost?
The cost of legacy system modernization depends on the approach. API wrapping can run 10,000 to 30,000 USD, a partial re-platform 30,000 to 80,000 USD, and a full rebuild can pass 100,000 USD. Moving module by module spreads the spend over time and shows results before you commit to the whole system.
Can you modernize a legacy system without downtime?
Yes. The Strangler Fig pattern lets you modernize a legacy system without downtime: new modules are built alongside the old ones, traffic moves over one module at a time, and the old system is switched off in pieces. Characterization tests, which AI now writes quickly, confirm each new module behaves like the old one.
How long does legacy modernization with AI take?
A module-by-module legacy modernization with AI typically spends month one on inventory and documentation, month two on tests and design, and puts the first module in production around month three or four. Later modules move faster. A single big-bang rewrite still takes years and puts all the risk on one launch day.
Which legacy languages can AI help modernize?
AI helps modernize legacy systems written in COBOL, RPG (IBM i, formerly AS/400), Visual FoxPro, Pascal, Delphi, Visual Basic 6, PowerBuilder, Clipper and Progress 4GL. In all of them it reads the code, documents it and drafts tests, but it makes more mistakes in languages with little public code, such as RPG or FoxPro, where human review carries more weight. With FoxPro and Delphi it often pays to wrap the system in an API before migrating it.
Newsletter
Get the best articles in your inbox
We respect your privacy. Unsubscribe anytime.



