Skip to content
We servePakistanUSACanadaUKDubaiAustraliaGermany
  1. Home
  2. Blog
  3. Laravel Development Services Blog
  4. How to Upgrade a Legacy Laravel App

How to upgrade a legacy Laravel app without breaking production

To upgrade a legacy Laravel app safely, back up everything, add tests around critical features, then move one major version at a time on a separate branch, fixing deprecations and replacing abandoned packages as you go. Test on staging with a copy of real data, and deploy with a rollback plan.

By Junaid Tariq Updated October 2026

Key takeaways
  • Upgrade one major version at a time and run the tests after every step.
  • Write tests for payments, permissions and imports before touching the framework.
  • Abandoned packages cause more delay than Laravel itself.
  • If the code is a mess, a staged rebuild can cost less than a heroic upgrade.

Why old Laravel apps get stuck

Nobody plans to run an unsupported framework. It happens because the app works, the original developer left, and every upgrade conversation loses to a feature request. Two or three years pass. Then a hosting provider drops an old PHP version, a security advisory lands, or a payment gateway changes its API, and the delay suddenly has a price.

An old version does not just miss new features. It stops receiving security fixes, and the packages around it stop supporting it. Each year of waiting makes the jump larger and the code less familiar. The honest message is that upgrades are cheapest when done a little at a time, and most legacy apps arrive at our door after the little-at-a-time stage has been skipped.

Before choosing a path, find out what you really have. Check the current Laravel and PHP support policy on laravel.com, read the composer file, and see which packages are still maintained. That ten-minute look usually tells you whether you face a routine upgrade or a rescue.

A safe upgrade path, step by step

This is the order we follow on Laravel upgrade and migration projects.

  1. Freeze and back upTake a full database backup and a code snapshot. Stop unrelated feature work on the branch you are about to change.
  2. Audit the applicationList the framework version, PHP version, every package, custom service providers, scheduled jobs and anything that touches files or the server. You get a risk list.
  3. Build a safety netAdd automated tests around money, permissions, imports, exports and any report the business depends on. Even thin tests catch the worst breakage.
  4. Stand up a staging copySame PHP version as production, a recent copy of the database with personal data protected, and the same queue and cache setup.
  5. Upgrade one major version at a timeFollow the official upgrade guide for each version, fix deprecations, run tests, commit, and only then move to the next version.
  6. Replace or fork dead packagesFor every abandoned dependency, choose a maintained replacement or move the small part you use into your own code.
  7. Rehearse the deploymentRun the full release on staging, including migrations and cache clearing, and time it. Write the rollback steps down.
  8. Release and watchDeploy in a quiet window, check logs and error tracking, and keep the old release ready for a quick return.

Upgrade, refactor or rebuild: choosing the route

The right answer depends on the state of the code, not on how old it is.

Situation
Best route
Why
Clean code, a few versions behind
Staged upgrade
Low risk, mostly deprecations and package bumps
Works but has no tests
Add tests, then upgrade
Without them you cannot see what breaks
Heavy use of abandoned packages
Upgrade plus targeted rewrites
Replace the dead parts while moving versions
Business logic buried in views and controllers
Refactor first or rebuild in stages
Upgrading tangled code multiplies the risk
Original design no longer fits the business
Staged rebuild
Spending on an upgrade preserves a bad foundation
App is small and rarely changes
Rewrite the small app
Cheaper than repeated upgrade work

What usually breaks, and where to look

The same trouble spots turn up again and again on old applications.

PHP version gaps

Newer Laravel needs newer PHP, and older code may use functions that were removed. Check this first, because it drives the order of work.

Third-party packages

Authentication helpers, admin panels and payment wrappers are the usual blockers. Look at each repository's activity before planning.

Configuration and structure changes

Across major versions the default folder layout, config files and bootstrapping have shifted. Follow the official guide for each step.

Queues and scheduled jobs

These fail silently. Confirm that jobs still run and retry correctly after each change.

Authentication and sessions

Changes here can log everyone out or, worse, open a hole. Test every role.

Front-end build tooling

Old asset pipelines may not build at all on current Node versions. Plan time for it, and see our note on Livewire vs Inertia vs API plus React or Vue if a front-end rethink is on the table.

Pakistan-specific snags: hosting, handover and local gateways

A lot of legacy Laravel apps in Pakistan were built by freelancers, delivered by FTP onto shared hosting, and never touched again. Expect no version control, edits made directly on the server, and credentials in a chat history. The first job is simply recovering the real code from the live server and putting it in a repository, because the copy on someone's old laptop is rarely the one running.

Shared cPanel hosting often caps the PHP version or blocks command-line tools, which makes modern Laravel awkward. Moving to a VPS or a managed PHP host is often part of the upgrade, and it is worth doing with a proper deployment script rather than copying folders. Plan the cutover for a quiet business period and keep the old site reachable until you are sure.

Local payment and courier integrations deserve extra care. Wallet and bank gateways may use older API versions or fixed callback URLs that the provider must update on their side, so contact them before the release date rather than after. Our Laravel payment gateway integration team has handled those handoffs.

Common upgrade mistakes

Avoid these and you avoid most of the horror stories.

  • Jumping several major versions in one goIt hides which change broke what. Go one version at a time.
  • Upgrading without testsYou are then testing in production, with customers as the QA team.
  • Using production for experimentsAlways rehearse on staging with realistic data.
  • Ignoring the PHP and server sideThe framework is only one layer. Hosting, extensions and database versions matter too.
  • Letting scope creep inAn upgrade is not the moment to redesign every screen. Ship the upgrade, then improve.
  • No rollback planA release you cannot reverse is a gamble. Keep the previous build and a database restore path ready.

After the upgrade: staying current

The upgrade is only half the win. The other half is not ending up here again. Set a rule that dependencies are reviewed on a schedule, security patches go out quickly, and each major Laravel release is evaluated within a sensible window rather than ignored.

Many clients put this under a maintenance plan so that someone is responsible. Our Laravel maintenance and support service covers patching, monitoring and small improvements, and slow pages found during the work are handled the way we describe in Laravel performance optimization.

Finally, document it. A short readme with the PHP version, deployment steps, scheduled jobs and third-party accounts saves days for whoever picks the project up next.

Deciding when to stop patching

There is a point where each fix costs more than the last and nobody wants to touch the code. Warning signs include releases that need a specific person present, bugs that return after being fixed, pages that take long to load for no clear reason, and a hosting setup that cannot be reproduced. When three or four of these are true, an honest assessment will often favour a staged replacement over another round of patches.

A staged approach works well on Laravel. The new application runs beside the old one against the same database, modules are moved across one at a time, and the old code is retired as the last screen moves. Users see steady improvement, and the business is never forced into a single risky switch-over weekend.

Whichever path you pick, ask for a written plan that names the order of work, what will be tested, who signs off each release and how a failed release is reversed. A vendor who cannot produce that on paper will not manage it in production either.

Junaid Tariq
Junaid’s take, from experience

Junaid's take

In my experience the technical part of an upgrade is rarely the hard part. The hard part is deciding that it is worth doing before something breaks. Owners often wait for a crisis because the upgrade has no visible output. Customers do not see it. But the crisis version costs more and happens at the worst moment.

If your app is a few versions behind and the code is reasonable, upgrade it in stages and add tests as you go. If the code is genuinely tangled, I would be honest with you: a staged rebuild, module by module behind the same database, can be cheaper and calmer than forcing an old design through five version jumps.

Send us the composer file and a short description of the system through the contact page and we will tell you which category you fall into. For the wider service, see Laravel development services.

Junaid Tariq
Junaid TariqSEO and digital marketing consultant, Lahore

Junaid has worked on Laravel for more than 18 years, across SEO, paid media, web development and custom software. He founded SEOnumber1, builds WordPress plugins, CRMs and web applications, has served 500+ clients in 48 countries, and holds Google Ads, Analytics and Google Blue and Green Belt certifications. He is a National Level Award Winner in Digital Marketing. Read his story or ask a question about this article.

Need help applying this?

Send your name and number. We reply on WhatsApp with what we would do first. Free, no obligation.

Check the official documentation
FAQ

Frequently asked questions

Straight answers before you get in touch.

Can we skip versions when upgrading Laravel?

Technically you can try, but it is risky. Each major release has its own breaking changes, and skipping hides the source of failures. Moving one version at a time, with tests after each, is slower per step and faster overall.

How do I know if my Laravel version is still supported?

Check the support policy on laravel.com, which lists bug fix and security fix windows for each release. If your version is outside the security window, treat the upgrade as urgent, since known vulnerabilities will not be patched.

Will the upgrade change how the application looks?

It should not. A framework upgrade is a code and dependency change. Visual changes only happen if a front-end package is replaced, and we flag that before starting.

Should we rebuild instead of upgrade?

Sometimes. If the code has no structure, no tests and many dead dependencies, rebuilding in stages can cost less. We assess the code first and give you both options in writing. Our guide to choosing Laravel explains what a healthy base looks like.

How long will the site be down during the upgrade?

Usually it is not, because the work happens on a separate branch and staging server. The release itself can often be done in minutes, with a short maintenance window if database changes are involved.

Get Consultation

Want this done for your business?

Skip the trial and error with Laravel. Send us your website and we will tell you what to fix first.

  • Free audit and honest recommendations, no obligation
  • Direct access to the expert, no junior hand-offs
  • Reply within minutes on WhatsApp during business hours
JT
Junaid TariqAvailable now · replies in minutes

Request a call back

Pick your services and send. We save your details and open WhatsApp for you.

Please choose at least one service.
Please enter your name.
Please enter a valid phone number.
Please enter a valid email.
Call now
Get Consultation · No spam · Fast reply · Your details are saved so we never lose your enquiry