Guide · Migrations & System Modernization

Legacy System Migration
What Are the Real Risks (and How to Avoid Them)

Migrations rarely fail because of the technology choice alone. More often it's unchecked data, ghost integrations everyone forgot about, and a plan nobody tested beforehand.

Patrycja Biała
Adventure-movie style poster: a developer with a flashlight examining old code, with a note reading TODO: Temporary fix, Added 2012, Still temporary

In April 2018, millions of TSB¹TSB Bank, banking platform migration, April 2018, BBC reporting and Financial Conduct Authority findings. customers woke up unable to get into their bank accounts.

The bank was moving the data of more than five million customers from its old system to a new platform. After the switch, some couldn't log in to their accounts, others saw money disappear, and some logged in to find… someone else's account. The UK regulator, the FCA, later found that the data itself had been migrated successfully. What failed was the new platform, along with the planning and testing of the whole programme, and the bank didn't return to business as usual until December.

A legacy system is an old system that still works and that the whole company runs on: orders, invoices, the warehouse. Migration means moving all of that to a new system. A bit like moving a shop to a new location, except the shop has to stay open the whole time and customers can't notice that someone is moving the shelves.

Most legacy systems never make the news. They just keep running. Orders come in, users log in, nobody reports anything serious, and modernization slides a little further down the priority list every quarter.

Then the business wants to grow, and suddenly every new feature takes weeks to ship. A simple integration means rebuilding several modules, and developers find themselves wondering what might break this time.

Whether it's old .NET, Java, Rails, Node.js or PHP, the story is much the same. Somewhere in the legacy code, there's a comment saying TODO: temporary fix. It dates back to 2012. Nobody's touched it since, probably for good reason.

Forgotten code like that can get very expensive. In 2012, Knight Capital²Knight Capital Group, deployment error, August 2012, SEC filings. was rolling out a new feature across eight servers, and on one of them the new version of the code was never deployed. The feature reused a flag that had once switched on Power Peg, a function the firm had stopped using in 2003 but never removed. On that one server, the flag woke the old code up, and within 45 minutes it had sent millions of orders to the market, with losses the SEC put at more than $460 million. It wasn't a migration, just a routine deployment, but it shows how much risk sits in code nobody cleans up.

The documentation is just as old, and every time someone tries to add a new feature, they discover another part of the system nobody quite understands. Somehow, keeping the whole thing alive gets more expensive every year. On top of that, an old system nobody updates anymore is an easy target for attackers, and in companies covered by NIS2 senior management is responsible for cybersecurity, which I explain in my article on NIS2 and the Polish KSC act.

At some point, more time and money go into keeping the system running than into developing it.

Before You Rewrite a Single Line of Code: 4 Questions That'll Save You a Lot of Stress

The biggest threat to a migration is rarely the technology. Usually it's simply not knowing what's really hiding in your old system. Before you solemnly announce the project kickoff, ask yourselves these 4 questions.

  1. Who's going to clean up this data mess?

    Data migration is the easiest part to underestimate, because on a slide it looks like simple copying. Has anyone actually checked how many duplicates and 2008-era records with the address test@test.com you've got lying around? Without a clean-up, the new system will simply return the same wrong data, only faster.

  2. Do you know about ALL the integrations?

    An old monolith is like a house renovated by three generations. Each one added something of its own, nobody ever took anything out, and now nobody really knows where all that DIY plumbing actually leads. Forgotten invoicing scripts, side integrations with the CRM some intern bolted on five years ago, email webhooks, automatic connections nobody remembers anymore... The worst-case scenario is discovering them a week after switching off the old server, right when finance stops receiving payments.

    Business logic works much the same way as integrations. Over the years, the system picked up exceptions that hardly anyone remembers today. One customer has had free delivery since 2015, another has its own invoicing arrangement, and the sales report starts counting from the 25th of the month because a finance director once asked for it that way.

    Details like these rarely make it into the requirements for the new system. They only come to light when a customer calls to complain that they suddenly have to pay for courier delivery. That's why, before a migration, it's worth getting IT and the people who use the system every day around one table, so they can trace the real processes together.

  3. Can your team actually build with this stack, or are they still watching YouTube tutorials?

    That shiny new framework might look great on GitHub, but if the team is still learning how to use it, the migration can quickly turn into a very expensive programming course run on a live system.

  4. What's Plan B when something inevitably blows up?

    The Strangler Fig pattern (more on it below) lets you replace a system one piece at a time, but it doesn't guarantee an easy way back. Picture Friday at 5 p.m. and a new module that has been writing data in a new format since the morning. Routing traffic back to the old system won't undo what's already in the database. That's why the rollback plan has to be prepared and tested in advance, including what happens to the data written in the meantime.

If your backup plan is basically "we'll figure it out as we go," put the migration on hold. Finding out how resourceful your team is in production can get expensive fast.

How Do You Reduce Risk? The Strangler Fig Pattern: Build Beside It, Not Instead of It

Every team has its own Hulk. One look at the old code, and he wants to smash the whole thing and build something new on the ruins.

Rewriting the entire application from scratch sounds tempting. The trouble is, these projects can drag on for months and burn through the budget faster than anyone expected. And at the end of it all, you still have to switch everything over. If the data or integrations fail at that point, you're racing against the clock.

TSB found that out the hard way: once the whole bank had been switched to the new platform, problems had to be fixed live, and some customers were still feeling them months later.

That's why more and more companies are choosing the Strangler Fig Pattern, a name popularized by Martin Fowler. It comes from the strangler fig, which wraps its roots around another tree until it eventually takes its place. Sounds pretty brutal in nature, but in IT, it's a surprisingly charming way to put a legacy system to rest. The new system grows alongside the old one, nibbling away at it bit by bit, until the old system can be safely switched off.

The old system keeps running while the new one gradually takes over. Invoices go through the new system, orders still go through the old one. A routing layer, a kind of railroad switch, makes sure everything ends up in the right place. Nobody gets lost, and business carries on as usual.

That's the biggest advantage of this approach: if something breaks, it's easy to tell where, because only a little has changed at once. Migrate the whole system in one go, and you've got hundreds of changes and a very hard time pinning down the one that took production down.

The Devil Is in the Details

Imagine a company that has to move five parts of its system: orders, warehouse, invoicing, reporting and customer support. Every department thinks their module should go first, and nobody's particularly keen on waiting their turn.

  1. Migration order

    The team has complained about the warehouse module for years. It's the worst-written part of the system, and every change takes weeks. The obvious temptation is to start there and finally get it out of the way.

    The problem is that four months later, the warehouse still doesn't work. It turns out to be even more tangled than anyone expected. Nobody outside IT sees any results, and leadership starts asking where the money is actually going.

    Now picture a second scenario. The company starts with invoicing instead. It's technically simpler, but it causes daily pain for finance and blocks integration with the new payment provider. Four months later, it's already running in the new app, with the routing layer sending every invoice its way. Finance stops fixing errors by hand, users notice the change, and leadership gets its first proof that the project is heading the right way.

    There is one trap here. At first, the new module often shares a database with the old system, because that makes it easier to keep data consistent. But it also ties the two systems together, and a table change made for the new invoicing can break the old ordering module. A shared database should be a temporary arrangement, with a clear agreement on which system owns which data.

  2. Monitoring

    You need to know what you're moving and make sure nothing breaks along the way. Without knowing how the old system behaves, you have nothing to compare the new one against.

    So before the first switch, make sure you're collecting logs and metrics from the old system. Then run the same order through both apps and compare. If one of them rounds a price differently, you'll catch it before a customer does.

    Monitoring should be running before the migration, not after. Otherwise, your first bug-reporting system becomes... your users.

  3. People

    There's something else nobody really talks about. During a migration, the team ends up in two camps. One gets to play with the shiny new tech, while the other is stuck keeping the old system alive. You can almost hear the complaints: "How come they get all the fun stuff while we're still fixing this mess?"

    Before long, the second group starts feeling like they've been shipped off to Siberia while everyone else gets to build the company's future.

    People can sink a migration faster than the worst framework. And no update will fix that. When the person who knows all the quirks of the old system finally quits, they take years of knowledge with them, most of which was never documented. So rotate engineers between old and new code so that nobody gets stuck with legacy for good.

  4. Success

    You know the invoicing migration went well when accounting suddenly goes quiet. No angry emails, no screenshots asking, "Where did that number come from?!" Just silence, and in IT that's usually a very good sign.

Which Technology Should You Migrate To? It Depends on What Hurts Most Today

There's no single best technology for application modernization. If someone asked me which one to pick, my first question would be: "Well, what does your team already know?" A trendy framework nobody knows how to work with will only drag the project out. I'd also look at how easy it'll be to find developers and what it'll cost to maintain the system a few years down the line. And whether AI can actually help with the day-to-day work or just end up guessing half the time. Above all, the new system should solve the problems the team is struggling with today.

Where AI Actually Helps in Migration (and Where It Falls Flat)

Let's leave the stories about AI writing code all on its own to the marketing team. In practice, AI is most useful as a very fast, detail-oriented assistant who never complains about the boring stuff. It can help with architecture too: suggest a few ways to split the system, list the pros and cons of each, or point out dependencies that will make the migration harder. But the decision still has to be made and checked by someone who knows both the system and the business.

It's great at the grunt work that eats up developers' time. It can dig through old code, trace dependencies, help write tests, or generate similar modules.

Take a migration from ASP.NET to Laravel, for example. Older versions of ASP.NET Identity used different PBKDF2 configurations for password hashing, in other words, for the way passwords were protected. Figuring out how to handle them manually could take hours. AI can help untangle the differences much faster, but there's still a simple question to answer: can existing users log in with their old passwords?

I still wouldn't hand AI the wheel, though. It doesn't know why accounting needed something yesterday or which module is giving the business the biggest headache. It can suggest solutions, but someone has to make sure it hasn't made half of them up.

Sources
← All articles