Back to Services

PHP legacy refactoring and Symfony refactoring without a rewrite

PHP legacy refactoring means improving a grown PHP or Symfony application step by step, with tests first, instead of rewriting it. We upgrade from PHP 5 or 7 to PHP 8 and from old Symfony versions to current ones while the system stays in production. For companies whose business runs on code nobody wants to touch anymore.

Book a free intro call

The Legacy Code Challenge

Legacy PHP systems often carry the business, but over the years they collect technical debt, outdated dependencies and code nobody wants to touch. A complete rewrite is risky and expensive, and it stops new features for months.

Our PHP legacy refactoring works in small, tested steps. We put tests around the existing behaviour first, then refactor and upgrade PHP and Symfony piece by piece, so the system keeps running and new features do not have to wait.

One recent example: 15-year-old software in the medical sector, modernized while it stayed in production.

Common Legacy Challenges

✓
Slow development cycles and difficulty adding new features
✓
Outdated dependencies and security vulnerabilities
✓
Poor documentation and knowledge gaps
✓
Difficulty recruiting developers for outdated tech stacks
✓
Performance issues and scaling limitations

Our Modernization Approach

Incremental Refactoring

Instead of risky big-bang rewrites, we use the strangler fig pattern and other incremental techniques to gradually modernize your codebase while maintaining full functionality. Each iteration delivers measurable improvements.

Safety First

We establish comprehensive test coverage before making changes, use feature flags for controlled rollouts, and maintain rollback capabilities at every step. Your business continuity is our priority.

Performance Optimization

Beyond code structure, we optimize database queries, implement caching strategies, improve algorithms, and eliminate bottlenecks to make your legacy system perform like modern software.

Knowledge Transfer

We document everything, train your team on new patterns, and establish coding standards that ensure improvements are sustainable long after our engagement ends.

The Modernization Journey

1
Phase 1

Assessment

Analyze current state, identify pain points, map dependencies

2
Phase 2

Stabilization

Add tests, fix critical bugs, establish baseline metrics

3
Phase 3

Modernization

Refactor code, update dependencies, improve architecture

4
Phase 4

Optimization

Enhance performance, scalability, and maintainability

5
Phase 5

Enablement

Train team, document patterns, establish practices

Technologies We Modernize

PHP & Frameworks

  • →PHP 5.x to PHP 8.x
  • →Legacy Symfony to Symfony 6+
  • →Laravel upgrades
  • →WordPress optimization

JavaScript & Frontend

  • →jQuery to React/Vue
  • →Legacy Angular to Modern frameworks
  • →ES5 to Modern JavaScript
  • →Build tool modernization

Backend & APIs

  • →Monolith to Microservices
  • →SOAP to REST/GraphQL
  • →Legacy ORM updates
  • →Database optimization

Infrastructure

  • →On-premise to Cloud
  • →Manual deploys to CI/CD
  • →Legacy servers to Containers
  • →Scaling improvements

Database Systems

  • →Query optimization
  • →Schema refactoring
  • →NoSQL migration
  • →Data archival strategies

Testing & Quality

  • →Zero tests to Comprehensive coverage
  • →Manual QA to Automation
  • →Code quality tools
  • →Performance monitoring

Common Challenges We Solve

Legacy modernization is not a single problem. It is a cluster of interconnected problems that accumulate over time. These are the situations we encounter most often when starting a new engagement.

PHP 5 or PHP 7 still running in production

PHP 5 reached end-of-life in 2018. PHP 7.4 followed in 2022. Running unsupported versions means no security patches, no modern language features, and increasing difficulty finding developers willing to work on the codebase. We handle the full upgrade path, resolving deprecated functions, updating Composer dependencies, and adapting framework-specific code, without breaking existing functionality.

A monolith that has become too large to change safely

What started as a well-structured application gradually becomes a tangle of cross-cutting dependencies. Changing one area causes unexpected failures in another. We apply the strangler fig pattern to systematically extract bounded domains into independently deployable modules, starting with the areas that change most frequently.

No test coverage on business-critical code

Many legacy systems were built before automated testing was standard practice. Developers know which areas are risky but have no safety net when touching them. Before modernizing any module, we add characterization tests that document existing behavior. This creates a regression baseline and gives your team the confidence to refactor.

Framework version locked years behind current

Symfony 2 or 3 applications are common in companies that built their platform in the 2013-2017 period. Upgrading across multiple major versions requires a structured approach: updating one major version at a time, resolving deprecation warnings before each step, and verifying behavior through automated testing. We have done this migration path repeatedly and know where the friction points are.

What a legacy refactoring engagement includes

We do not start with a big plan on paper but with your code. A legacy engagement with Wolf-Tech covers these deliverables, in the order your risks call for:

  • →A written assessment of the codebase: PHP and Symfony versions, outdated dependencies, security gaps and the riskiest modules
  • →Characterization tests around business-critical code before anything is changed
  • →The upgrade path from PHP 5 or 7 to PHP 8 and across Symfony major versions, one version at a time
  • →Automated refactorings with Rector and static analysis with PHPStan, reviewed by a senior developer
  • →A CI pipeline that runs tests and analysis on every change, so the improvements stay in place
  • →Documentation and pairing sessions so your team can maintain the modernized code on its own

What does PHP legacy refactoring cost?

The cost depends on the size of the codebase, the distance to current PHP and Symfony versions, the existing test coverage and how much the system is still changing. A blanket price would be guesswork, so every engagement starts with an assessment. It ends with a prioritized plan and an effort estimate per step, and you decide how far you want to go. Our article on what legacy refactoring services deliver, what they cost and how to evaluate a partner covers the cost factors.

How long does a PHP or Symfony upgrade take?

That depends on how many major versions lie between your system and the current one and on how much code relies on deprecated features. You get the timeline per upgrade step after the assessment. In our case study, the move from Symfony 2 to 7 took fourteen months while the team kept shipping features. How that works without a feature freeze is explained in keep shipping features while someone fixes the foundation.

Should you refactor or rewrite a legacy application?

In most cases refactor. A rewrite has to rebuild every rule the old system has learned over the years, often without documentation, while the old system still needs maintenance. A rewrite makes sense when the platform itself is dead, for example an unsupported framework without an upgrade path, or when the business has changed so much that little of the old logic is still valid. Our decision framework for rewrite vs. refactor lists the criteria.

Frequently asked questions about legacy refactoring

Does the system stay online during the refactoring?+

Yes. We work in small, tested steps, use feature flags for risky changes and keep a rollback option at every step. Your users keep working while the code underneath gets better.

Our code has no tests. Can you still work on it?+

Yes, that is the normal case. Before we change a module, we write characterization tests that record its current behaviour. They catch unintended changes and make later refactoring safe.

Which PHP and Symfony versions do you upgrade from?+

From PHP 5.x and 7.x to PHP 8, and from Symfony 2, 3 or 4 to current versions. We also modernize Laravel applications and applications built on a home-grown framework.

Do you also take over ongoing maintenance?+

Yes, if you want. After the modernization we can handle updates, security fixes and further development, or hand over to your team with documentation and coding standards.

Can our developers keep working on features at the same time?+

Yes. We agree on a fixed share of capacity for the modernization, and your team keeps delivering features. Small steps and frequent merges keep conflicts between both streams small.

How do we get started?+

With a conversation about your system, followed by an assessment of the codebase. You get a written report with the risks and a prioritized plan, and then decide whether and how we continue.

Case study · B2B SaaS · Mittelstand

Symfony 2 → 7 Modernization Without a Feature Freeze

−63% build time

A 700,000-line B2B SaaS product moved from Symfony 2 and Doctrine 1.x to Symfony 7 in 14 months, step by step and while new features kept shipping.

Read the case study →

Ready to Modernize Your Legacy System?

Let's discuss how we can breathe new life into your codebase without disrupting your business.