Upgrading to Craft 5: what’s involved, and why it can’t wait
Upgrading to Craft 5: what’s involved, and why it can’t wait.
If your site still runs on Craft 2, 3 or 4, last month’s PHP security scare is a good reason to stop putting the upgrade off. Here’s what an upgrade actually involves, from someone who is about to take a theatre company’s site from Craft 2 all the way to Craft 5.
Why now?
On 21 October, PHP released emergency fixes for two critical flaws, nicknamed PHP2Shell, that let an attacker run code on a web server without logging in. Attacks started within hours, before the fixes were even out. Patches were released for PHP 8.2 and later. Older versions of PHP get nothing.
That matters because your version of Craft decides which version of PHP you can run. Craft 5 needs PHP 8.2 or later, so it runs happily on a patched server. Craft 2 can’t run on any version of PHP that still gets security fixes.
Craft itself has the same problem. Each major version gets security fixes for a limited time:
- Craft 2: no security fixes since January 2022
- Craft 3: no security fixes since April 2024
- Craft 4: no security fixes since April 2026
- Craft 5: security fixes until the end of 2031
An unsupported site doesn’t break on the day support ends. It keeps working, and it gets a little more exposed every time something like PHP2Shell comes along.
You can’t skip versions, but you can start again
Craft upgrades in place one major version at a time. A Craft 2 site goes to 3, then 4, then 5, and each step runs its own database migrations and needs a newer version of PHP. Every plugin also needs a working migration at every step, and some older plugins never got one.
For the oldest sites there’s another route: build a fresh Craft 5 site and import the content into it. That’s how I’m approaching the theatre site I mentioned. It runs Craft 2.6 on PHP 7.1, with 21 plugins, several of which never made it to Craft 3. Rather than drag it through three upgrades, I’m scripting an export from the old site and an import into the new one. Because it’s scripted, it can run again on a fresh copy of the content just before launch, so nothing added in the meantime gets lost.
Either way, Craft 5 needs PHP 8.2 and MySQL 8.0.17 or later (or a recent MariaDB or PostgreSQL), which older hosting often can’t provide. On the oldest sites, moving to new hosting is part of the job.
What the work involves
Running the upgrade command is the easy part. The work is everything around it.
- A plugin audit. Every plugin needs a compatible version for each release you pass through. Some were abandoned along the way, so they need replacing, or the feature rebuilt another way.
- Content model changes. Craft 5 turned Matrix blocks into entries, and field types from plugins like Super Table and Neo need their own migration plan. Get this wrong and content can be lost or quietly mangled in ways you won’t notice for weeks.
- Templates and custom code. Craft’s template APIs have changed a lot since Craft 2. Templates from that era usually need significant rework, and any custom modules need updating at each step.
- A local copy first. I run the whole upgrade on a copy of your site and database, and test it thoroughly before the live site is touched. Then it goes live with a fresh backup and a way back.
Upgrade or rebuild?
For a Craft 4 site, an upgrade is usually a contained, fixed-price job. Craft 2 and 3 sites are a different decision. If the templates need rewriting anyway, it can make sense to refresh the front end at the same time while keeping all of your content. Sometimes that costs little more than a straight upgrade, and you end up with a faster, more accessible site rather than the same old one on a newer version.
What does it cost?
Honestly, I can’t tell you until I’ve looked. The cost depends on how far you have to come, which plugins you use and whether they survived, how much custom code there is, and how your content is modelled. None of that is visible from the outside.
So every upgrade starts with a site audit. I go through your plugins, content model, templates and hosting, and tell you which route makes sense and what it will cost. A Craft 4 to 5 upgrade usually becomes a fixed-price project from there. Older sites take longer to scope, but you’ll get a fixed quote before any work starts.
Not sure which version you’re on? Send me your site’s address and I’ll find out.
Then stay there
Once you’re on Craft 5, keeping it current is the cheap part. A maintenance plan keeps Craft, your plugins and PHP up to date month by month, so you never face a jump like this again.
Ready to make the move? Have a look at how I handle Craft upgrades, or get in touch.