I promised myself that starting this week I'd switch to lighter topics. But on Monday, my JSNation adventure officially came to an end, and I realized I hadn't written a single article about my talk yet. Since everything is still fresh in my mind, here we go!
As for JSNation itself, I have mixed feelings. I was selected for the online track and, despite the organizers' incredible professionalism, it just wasn't the same as being there in person. You know, I could have been in Amsterdam drinking beer with Wes Bos, but instead I was watching my own talk from the kitchen while replying to Teams messages. π Still, it was a great experience. And who knows? Maybe my expertise, or my level of celebrity status π will grow enough that one day I'll get to speak in Amsterdam in person.
That said, I might visit that beautiful city later this year anyway, but let's not get ahead of ourselves. π
Back to the topic. My talk was called "Rewrite or Refactor? How to Safely Move Legacy Apps to Modern Frameworks." I believe I'm the right person to talk about this. Why? Because I've migrated a lot of frontend apps throughout my career, in all kinds of configurations: old Angular to modern Angular, ASP.NET MVC 5 to Vue, React with class components to modern React, and so on.
The reason is simple. If a company desperately needs a migration and suddenly receives a CV from someone who's already done one, they're usually very happy to hire that personβeven for a slightly above-market rate. π That's basically how I became a frontend migration expert, and I definitely have a few things to say about it.
But why migrate at all?
Before discussing strategies, we need to answer a more fundamental question: why migrate in the first place?
I've heard this question many times from stakeholders, especially non-technical product owners. If the application works, why touch it? Developers are just chasing hype and trying to put shiny technologies on their CVs, right?
My answer is usually very simple and honest.
You know me well. I'm not a fanboy of any particular framework. To me, they're just tools. Like hammers. But when I'm building something, I'd rather use a solid, reliable hammer than a rusty one with missing parts. ππ¨βοΈπͺπ§πͺ
But migration isn't just about developer experience. In reality, it's about the survival of your product. Especially today, when technology evolves faster than ever and AI is accelerating everything even further.
Take security, for example. When a library becomes obsolete and nobody maintains it anymore, security patches stop coming. Vulnerability reports start turning red. No product owner in history has ever said, "Sure, let's sacrifice security for a few extra features!" At least I hope so π
And let's not forget modern tooling. Vite builds alone can make a huge difference. Modern applications are simply faster, and faster applications are better applications.
There are many more reasons, but the most important thing to remember is this:
The longer you postpone a migration, the harder and more expensive it becomes.
Okay, okay, I want to migrate. But how?
Interestingly, the arrival of LLMs hasn't fundamentally changed migration strategies. They're basically the same as before AI became mainstream. Sometimes the work is faster, sometimes it isn't, but the underlying approaches remain unchanged.
There are probably as many migration strategies as there are senior engineers, but in practice they fall into two categories:
Rewrite (Big Bang Strategy)
Rewrite the entire application β or, as often happens on the frontend, upgrade an ancient stack directly to the latest version of the framework.
Refactor (Strangler Pattern)
Rewrite the application piece by piece while continuing to deliver features.
So, which approach is better?
Honestly, there's no point starting a holy war over this. In most cases, the realities of your project decide for you.
If your application is relatively small, your team is experienced, your documentation is decent, and you can afford to pause feature development for a few weeks or months, a rewrite may be a perfectly reasonable choice.
On the other hand, if you're working on a huge project with lots of junior developers or people unfamiliar with the technology, and the documentation is practically nonexistent β an incremental refactor is probably your only realistic option.
Of course, there are many other factors to consider. Here's a quick summary:
| Factor | Rewrite (Big Bang) | Refactor (Strangler) |
|---|---|---|
| Application size | Small or medium | Large |
| Feature development | Can be paused | Must continue |
| Documentation | Good | Poor |
| Team experience | High | Mixed |
| Risk tolerance | Higher | Lower |
| Time to first results | Short | Long |
| Complexity during migration | Lower | Higher |
| Risk of endless migration | Low | High |
Big Bang β Not as scary as it sounds
Let me briefly describe both approaches, starting with Big Bang.
I have to admit β I like this strategy. Sure, books and articles often describe it as risky, sometimes even as an anti-pattern. And they're right β if we're talking about a twenty-year-old Java monolith that nobody dares to touch.
But many frontend applications are relatively young and relatively small. In those situations, a Big Bang approach can simply be faster and cheaper.
Full rewrites are relatively rare these days. However, large upgrades are quite common: for example, moving from Angular 7 to modern Angular with Signals, or from old React with class components to modern React with hooks.
These projects still require a lot of work and a lot of digging through old code, but you'll reach the finish line much faster than with a Strangler migration.
I'm not going to describe planning phases, migration scripts, codemods, or the specific tools I've used. Those details vary from project to project and don't make much sense in a general article.
However, there are certain things that show up with surprising consistency in almost every migration. π
Real-Life Example: Big Bang migration from Angular 7 to latest Angular
Here's an interesting example. Sometimes we wonder how a team could possibly let an application go years without upgrades. In reality, it's surprisingly easy, especially when nobody is actively working on it because the product is in maintenance mode and hasn't changed significantly in years.
That was exactly the case here.
Then one day, the stakeholders decided to expand the application significantly and add several new features. I convinced them to upgrade to the latest Angular version, mainly for security reasons β the system stored critical data.
Long story short, four developers upgraded it to the latest version in four months. And it turned out to be much harder than I expected.
First of all, it's easy to underestimate the scope of the problem. From the outside, it looks simple: "Just upgrade Angular."
But the framework itself is rarely the real problem. The ecosystem around it is.
For example, our primary component library introduced major syntax changes somewhere between versions 12 and 13. Imagine how many places needed to be updated! Sure, AI can help, but if an ambitious UI engineer decides to rename CSS classes and change component structures, AI won't save you β you'll end up fixing things manually.
Some third-party libraries had long been abandoned. And here's something worth remembering:
If you have a library that hasn't been updated in years, whose author has apparently forgotten it exists, and it doesn't even compile on Node 18 anymore, that's not "working code." That's a time bomb.
And yes, we had plenty of end-to-end tests. Many of them exploded because of changes in the component library. π So even automated tests won't always save you.
Another important lesson: always have a solid branching strategy for hotfixes. Assume something will go wrong. Because eventually, something probably will.
Fortunately, the migration was a success.
Build times improved dramatically. The bundle size shrank significantly. The new layout looked much better than the old one, so even the most technology-resistant stakeholders were impressed.
And perhaps most importantly, the application became ready for future upgrades. Even the QA teamβwhich initially hated us, eventually admitted that upgrading regularly is much better than doing it once every seven years π€£
Incremental migration β having your cake and eating it too
Sometimes, though, your application is simply too large for a Big Bang approach, or you can't afford to stop delivering features. In that case, incremental migration becomes the only realistic option.
This type of step-by-step refactoring is usually implemented using the Strangler Pattern. There are other approaches, of course, but I personally like this one because it's elegant, relatively simple, and battle-tested by some of the largest tech companies in the world.
So what exactly is the Strangler Pattern?
Take a look at the beautiful diagram below, handcrafted by yours truly in draw.io. π
As you can see, you start with your legacy application. You build a new application alongside it. Then you place a reverse proxy in front, which decides which routes go to which application.
From there, you migrate screen by screen, route by route. Over time, the legacy application becomes smaller and smaller until, hopefully, all that's left is the new one, and you can finally get rid of both the old app and the reverse proxy.
In this scenario, both applications should share authentication and the backend, but not frontend code.
And if you absolutely must make the two applications communicate, I'd strongly recommend using something simple like custom DOM events instead of so-called "temporary" adapters.
Because we all know what "temporary" means in software engineering. Forever. π And before you know it, those adapters become a brand-new piece of legacy.
Real-life example: Migrating from Backbone to Vue with the Strangler Pattern
This was an old application written in Backboneβand I have to admit, it was actually very well written. Still, it was Backbone. π
The application wasn't huge, so a Big Bang migration was theoretically possible. But we were a startup, and one day we heard these famous words: "Guys, we just sold a feature that doesn't exist yet. You have three months to deliver it. Have fun!"
My immediate reaction was: "Hahaha. Very funny. There's no way I'm building that in Backbone." Luckily, our stakeholders were smart and agreed to a Strangler migration.
My team consisted of me and... two junior Java developers who, I swear, heard the word "TypeScript" for the first time in their lives.
Fortunately, they were ambitious and learned quickly. Well, they didn't really have much choice. π And that's another advantage of this strategy: junior developers can learn meanwhile.
I created a new Vue application on the side. A lot of people in the company already knew Vue, so the choice was obvious.
First, I migrated the login screen as a proof of concept. Then we moved on to the shiny new feature the client had already paid for. π
For the next year, we migrated the application screen by screen.
Eventually, Backbone disappeared completely. And throughout the entire process, we had zero downtime. Customers didn't even notice that a migration was happening.
Just like in the previous example, the bundle became significantly smaller, and build times improved dramatically.
However, the Strangler approach isn't all sunshine and rainbows.
First of all, there's the time factor. The migration process takes a long time. In our case, with a relatively small application, it still took an entire year.
There's also the danger of the never-ending migration. You probably know what I mean. Deadlines pile up. Features keep coming. And after a while, you find yourself almost begging your product owner to spare a few story points for migration work.
And unfortunately, there's no way to avoid touching legacy code. Zero chance. And believe me, developers hate it. I've heard things like: "Sylwia, why are you making everything so complicated? Now we have to know two technology stacks!"
So no matter which strategy you choose, you'll probably become the team's scapegoat. At least while the migration is in progress.
But once it's over, the bundle size has been cut in half, vulnerability reports stop glowing red, and customers stop complaining, you'll suddenly become the company's hero. π
A Few Final Words
Migrating legacy applications is a lot like buying an old house. It's not your fault that it's falling apart, but it is your responsibility to bring it back into shape. You can take a few weeks off and renovate everything at once, or you can move in and tackle one room at a time.
The only truly bad strategy is doing nothing. Sooner or later, you'll have to migrate anyway β except you'll be doing it because of a production incident. π
So, what's your approach to renovating your legacy applications?
Disclaimer
None of the stories described above actually happened. Or maybe they did? π
As both a professional and someone bound by NDAs, I deliberately created a blend of several migration stories to make sure no company or project could be identified. That wasn't particularly difficult, because after a while all migrations start to look surprisingly similar. π
If you like my articles, you can also follow me on LinkedIn.




Top comments (34)
Excellent article! This reminded me of one of my own migrations.
My last migration was from an old PowerBuilder desktop application. In our case, migration was no longer optional: the only developer who truly understood the app had already retired, there was almost no documentation and the codebase was a mess. π
We tried to follow the Strangler Fig pattern, but the business logic was so tightly coupled that we had to take a more waterfall-like approach and migrate large features end to end. It was not necessarily the safer approach, but without it, we would have ended up with hundreds of feature flags and an even harder system to manage.
That made the risk very real and it showed exactly why waiting only makes legacy systems harder and, in some cases, ultimately much more expensive to replace.
That's so true. We all love talking about patterns and best practices, and then reality shows up. π
Sometimes the textbook solution simply doesn't fit the constraints of the project, and you have to adapt. In the end, getting the migration done is more important than following a pattern perfectly.
And honestly, your story reinforces what might be the main message of the article: don't postpone migrations. The longer you wait, the fewer options you have, and the more expensive and risky everything becomes.
Exactly. As always in software development, it is all about trade-offs.
I agree, but at the same time, I understand why migrations get postponed, a running product still needs to generate revenue and migrating a legacy system can require a significant investment.
Maybe the better approach is to continuously maintain and modernize the product before a full migration becomes unavoidable. That also requires budget, but in the long run, it can be much cheaper and less risky than being forced into a large migration later.
Exactly! These things are never easy.Β
But I've seen migrations postponed even during relatively quiet periods because they were considered annoying and disruptive. Product owners would complain that they were a burden for developers, testers, and everyone involved. That's when my favorite argument came into play: security. π
I'd scare them a little, and later they'd thank me when customers started running security audits. What a surprise. π
And yes, continuous maintenance is definitely the best approach. A migration from Angular 7 to 21 is a nightmare, but going from 21 to 22 is almost trivial. That's the beauty of keeping things up to date: future migrations become boring, which is exactly what you want.
That "temporary" adapter joke hurt π We had one of those bridge solutions hanging around for three years before someone finally killed it. Nobody even remembered what it was for anymore. Thanks for writing this.
Hahaha, exactly! π That's how those "temporary" adapters usually end up.
And honestly, the only thing worse than finding one after three years is realizing that it's still needed after three years. π
And nobody dares to touch it because 'it still works' π until it doesn't.
Hahaha, exactly! π Or some nasty security vulnerability shows up and suddenly everyone is shocked. π
Every legacy system has that one file named
utils.js,helpers.java, orfinal_final_v2.cs.Nobody knows who wrote it.
Nobody knows what it does.
But everyone agrees touching it requires a change request, a rollback plan, and a prayer. π
Hahaha, exactly! π Every legacy system has one of those files. Even the coding agent takes one look at it and submits its resignation. π
π Somewhere inside that file is a comment from 2018 that says:
// temporary fix
And everyone is too afraid to ask temporary for whom.
π€£
Hahaha, exactly! π Maybe they meant temporary on a cosmic scale. π
Like, "temporary" for the remaining lifetime of the Universe.Β π€£
Sylwia, this brought back memories π
I've worked on legacy systems before, and one thing I've learned is that they usually look much simpler from the outside than they actually are. Once you start digging, you realize how many decisions, dependencies, and business rules have built up over the years.
A lot of the time, there is a reason things ended up the way they did, even if it isn't obvious at first.
Exactly! π And until you've spent enough time in the project, you usually don't know what those reasons are.
People often assume that legacy code exists because somebody was incompetent. Then you dig into the history and discover that, six years ago, half the team left and two juniors were left on their own for six months, doing the best they could under the circumstances. π
Most of the time, there is a story behind the mess. And understanding that story is often harder than understanding the code itself.
First of all, it is always reassuring to learn that other developers face similar challenges in their projects and that I am not the only one who regularly ends up in impossible situations π
In my experience, front-end migrations pose an additional non-technical challenge: they directly affect the user experience. The moment anything looks even slightly different than before, screenshots have to be retaken, manuals have to be updated, and users have to be retrained. It is even possible that UI changes touch on legal issues, and you need approval from a governance body first. Accessibility is another topic I will not even get into now.
Back-end migrations are easier in this respect, but on the other hand, the customer is far more afraid that you will break the business. Shortly before the advent of AI, I was asked to consult on a COBOL migration project. The last of their developers was about to retire. After a long and winding road, the project decided to post a job advert for a new programmer. You should never underestimate how many red flashing warning lights humans can ignore for how long π
Oh yes, absolutely. π Frontend migrations almost always end up changing something in the UI, even if you're using a standard component library like Material. Fortunately, my experiences have generally been positive. Customers were happy because things looked cleaner and more modern. Of course, that's only true as long as the changes are relatively small. God forbid you change something significant, even for the better, because then everyone suddenly starts missing the old version. π
And I love that COBOL story. What resonates with me most is the part about humans being able to ignore red flashing warning lights for years. I've seen that so many times.
To be honest, I consider myself a fairly average senior developer in terms of pure technical skill and architecture. But I do have one thing that often pushes me into tech lead roles: social skills. π Sometimes I'm actually able to convince the business to listen to reason and deal with problems before they become catastrophes. Not always, of course, but often enough to make a difference. π
I wonder if simply showing the article's title image would be enough to convince stakeholders to migrate to a new stack. It looks surprisingly convincing! π
Hahaha, exactly! π We all prefer living in the shiny city of the future rather than in a gloomy industrial landscape that feels like Eastern Europe in the 90s. π
Great read! You make a lot of excellent points about the psychological and technical friction of migrations, especially on the front end, where frameworks move at lightning speed.
But your post also made me think about a completely different tier of "legacy" code, the kind that doesnβt just predate modern frameworks, but actually predates the public internet entirely.
Iβm talking about the deeply buried back-end bedrock, like COBOL systems or AS-400 applications. These are the quiet, invisible giants running our global financial institutions, municipal supply chains, airlines, and government agencies every single second of the day.
In those ecosystems, "the longer you wait, the worse it gets" takes on a terrifyingly literal meaning. It's not just that the codebase grows sprawling; it's that the pool of engineers who actually understand the business logic and syntax is literally aging out of the workforce. When a critical corporate ledger or transaction system relies on logic written in the 1970s or 80s, a migration isn't just a refactor; it's high-stakes digital archaeology where a single misstep can halt critical infrastructure.
It really puts the definition of a "legacy system" into perspective. Working on those deep back-end monoliths feels less like maintaining tech debt and more like defusing a bomb made of decades-old logic.
Have you ever had to bridge the gap between a modern front-end layer and one of these deep, ancient enterprise back-ends?
Thanks for this comment! And yes, I completely agree. The scale of some of these systems is truly mind-blowing.
Someone in the comments here mentioned that they once joined a COBOL project as an intern and discovered that part of the code had actually been written by their mother, who had long since retired. π That really puts things into perspective.
Personally, I've never had to build a frontend on top of a COBOL or AS/400 system, but I can absolutely imagine the challenges because I once worked with a Java backend that had originally been created as a proof of concept about 15 years earlier. Then the project kept growing and growing, and eventually people discovered that making even simple changes had become a nightmare. Adding a single form meant touching more than 80 files. π
And I don't think that was necessarily because the original developers were incompetent (although, like in every project, that probably played some part). More likely, nobody expected the project to reach that scale when it started. There were discussions about fixing the architecture, maybe splitting it into microservices, but deadlines kept coming, priorities shifted, and eventually I moved on. I honestly don't know how that story ended.
Which, I guess, is exactly how legacy systems are born in the first place.Β
I remember that I had a former friend where his father used to work with Cobol system.
Hahaha, from what I've heard, that's basically a gold mine these days. π
I mentioned COBOL to my father and he burst out laughing. He learned it back in the 1960s. Meanwhile, the Canadian government is finally moving away from those legacy systems and leaning into AI these days.
Hahaha, I always say that if AI has made its way into government systems, then it's officially everywhere. π
Governments are usually among the most conservative organizations when it comes to technology, so when they start embracing AI, you know it's no longer just hype. The future has already arrived. π
hahaha. Yeah, my current premier minister is huge in technology. He want to modernize the public civil serve and make productive like the private industry. He is a business man in most of his career.
Hahaha, that's nice. π Unfortunately, ours is more of a career politician. π
Oh wow!
Very Very Great Article Sylwiaπ The longer you wait, the worse it gets this is the most honest truth in software We had a 2,000-line process() function that no one touched for years We called it The Heart of Darkness. When we finally had to change it, we learned more about the codebase in one week than in two years of avoiding it.
The code wasn't scary because it was complex. It was scary because we didn't understand it. And the only way to understand it was to touch it.
Thanks for the reminder. π
Hahaha, I love "The Heart of Darkness"! π Every legacy application seems to have one of those.
And you're absolutely right. Sooner or later, somebody has to touch it. The code itself usually isn't scary because it's inherently complex, but because nobody understands it anymore. And unfortunately, the only way to understand it is to dive in and start changing things.
Which is exactly why I'd rather do it sooner than later. π
Few years ago I was involved in migrating a oracle forms app to a React app. It was a total mess. Before us one of the leading tech company has tried to do it and failed. We, the in house team started the migration on top of that code base. When I read this article I understand why it was a mess. Learned so many things that I shouldnt do in a migration, from that project.
Thank you! π And that's exactly how I see it too. When it comes to architecture and migrations, I often catch myself realizing that people have already encountered most of these problems before us. There are patterns, best practices, and lessons learned, and it's usually much better to learn from other people's mistakes than from our own. π
Of course, reality always finds ways to surprise us, but having those battle-tested ideas in the back of your mind makes things much easier. If my article helped you put some of those experiences into perspective, then I'm really happy to hear that. π