Modernising Legacy PHP: Step by Step with Symfony
AI generated
Modernising legacy PHP without a big bang: how step-by-step migration with Symfony and the strangler fig pattern works and how to start.
Many companies run PHP applications that have grown over ten or fifteen years. They carry core processes, but every change is risky, developers are hard to find and the PHP version has long been out of support. The temptation to rebuild everything is strong.
But a rebuild in one go is expensive and risky. A proven alternative: modernise legacy PHP step by step, with Symfony as the new foundation, while the old application keeps running.
At a glance:
How to tell that action is needed
Why a big bang is rarely the best solution
How step-by-step migration with Symfony works
How to get started
How to tell that you need to act
Outdated PHP version: according to php.net, PHP 8.1 and older no longer receive security updates, and PHP 8.2 only until 31 December 2026.
No framework, or an outdated one: custom structures that only a few people still understand.
Fear of change: every new feature causes unexpected errors somewhere else.
Missing tests: nobody can say for sure what a change will break.
If several of these apply, the application turns from a tool into a risk.
Why a big bang rarely works
A complete rebuild takes a long time. During that time, the old application still has to be maintained, and the business doesn't wait. At the end, there's a cut-over date on which everything has to work at once. Errors then hit the entire operation.
That's why the Symfony documentation explicitly recommends a step-by-step approach without a big bang for existing applications.
How step-by-step migration with Symfony works
The pattern behind it is called strangler fig: the new application takes over the old one's functions piece by piece until the old one can be switched off. According to Symfony, it works like this:
Create a shared foundation. Both applications run on the same server and share dependencies via Composer.
Build a safety net. Before code changes, end-to-end or smoke tests secure the most important flows.
Put a front controller in front. All requests go to Symfony first. If Symfony doesn't know a route, the request is passed on to the old application.
Take over feature by feature. New features are built directly in Symfony, and old areas are moved over step by step.
That way, there's no risky cut-over date. Each migration step is small, testable and can go live on its own.
The catch: for a transition period, two worlds run in parallel. That needs clear rules about which areas live where, and the discipline to actually retire the old parts.
What this means for your team
During the migration, your team works in both systems. New developers start in Symfony, which is widely used and well documented. That makes recruiting and onboarding easier.
At the same time, the application becomes more secure and better tested with every step. The benefit doesn't only arrive at the end; it builds up continuously.
Our recommendation: start with a code audit. It shows where the biggest risks are, which areas should move first and whether a rebuild makes sense for some parts.
How to start the modernisation
Run a code audit. Assess architecture, security, performance and technical debt.
Check the PHP version. Plan the move to a supported version such as PHP 8.4.
Write tests for core flows. Secure checkout, login, orders or other business-critical paths.
Put Symfony in front. Set up a front controller with a fallback to the old application.
Migrate step by step. Start with a well-defined area and gather experience.
Conclusion: you can modernise legacy PHP without standing still
Modernising legacy PHP doesn't mean throwing everything away. With Symfony and the strangler fig pattern, you replace the old application step by step without putting operations at risk.
For businesses, that means less risk, earlier results and a codebase that becomes maintainable again.
As a Symfony agency, we take over existing applications, start with a code audit and modernise them step by step. We explain what makes Symfony stand out as a framework on our Symfony page.
Frequently asked questions
What is the strangler fig pattern?
With the strangler fig pattern, a new application gradually takes over the functions of an old one until the old one can be switched off. Both run in parallel during the transition.
Do I have to rebuild my old PHP application from scratch?
Not necessarily. A step-by-step migration with Symfony is often safer and cheaper. A code audit shows which parts should be modernised and which rebuilt.
Which PHP versions are still supported?
According to php.net, PHP 8.2 (security updates until 31 December 2026), 8.3, 8.4 and 8.5 are currently supported. PHP 8.1 and older no longer receive updates.
How long does a legacy modernisation take?
That depends on the size and condition of the application. Because the migration happens step by step, the first areas can go live early, while full replacement takes longer.