Skip to content
Scalpels home

Sign up now for $10 in credit on a new Laravel Cloud account.

← All tutorials

Tutorial

Bring a Legacy App Up to Date

In October a lot of teams found out how stressful it is to run an old app when a critical vulnerability is announced. The patch exists, but it only ships for supported versions. If your app is three framework versions behind, "apply the patch" turns into "do the upgrade you have been putting off for two years," and you have to do it this week.

Getting onto supported versions of Laravel, PHP, and your operating system is cheaper and easier than it has ever been. Static analysis tells you what is broken before you change anything. Rector rewrites most of the code for you. An AI coding agent can handle most of what Rector leaves behind, as long as you give it a precise list of what to fix.

This series walks through that process on a real app, one step at a time.

What "up to date" means here

An app is up to date when three things are true:

  • It runs on a Laravel version that still gets security fixes.
  • It runs on a PHP version that still gets security fixes.
  • It runs on an operating system and server stack that still get security updates.

You do not need the newest of everything. You need to be inside the support window, with a short and boring path to the next version.

The order we use

  1. Take stock. Find out exactly where you are and how far you have to go.
  2. Find what is broken. Run PHPStan and record a baseline before you touch any code.
  3. Let Rector do the bulk. Upgrade one version at a time, with automated rewrites.
  4. Hand the rest to AI. Give an agent the remaining errors as a task list.
  5. Move the server. Put the upgraded app on a supported runtime.
  6. Stay current. Make the next upgrade small enough that you never need this series again.

The first two steps are enough to tell you how big the job is, which is the question most teams need answered first.

What you need

  • The app in Git, with a branch you can break.
  • A local environment that can run the app's current PHP version.
  • Whatever tests the app has, even if there are not many.
  • About an afternoon for the first two steps.

Need some help?

These agencies and freelancers are standing by and ready to help.

  • Scott Keck-Warren

    Michigan

    PHP and Laravel developer with 13 years of experience building and maintaining production apps. US Eastern, English.

    Freelancer Ask for help
    Ask Scott Keck-Warren for help
  • Artisan Build

    USA

    We run Scalpels, as well as a suite of other tools for developers and development teams.

    Agency Ask for help
    Ask Artisan Build for help