Categories

Roles

Talk to us about a team › Hourly, monthly or fixed scope — Schedule a call ›

How to Upgrade From Craft CMS 4 to Craft 5 Without Breaking Your Site?

Mukul SinghJuly 22, 2025 4 min read

Many businesses or website owners think Why should I even consider upgrading from Craft 4 to Craft 5?

It's a great question, though. But think of it this way. Upgrading from Craft CMS 4 to Craft CMS 5 isn’t just about staying current. It’s about setting up a website for better performance, stronger security, and long-term sustainability.

Craft CMS 5 upgrade benefits include:

  • Security you can trust: Craft 5 brings built-in 2‑factor authentication and passkey support (like fingerprint or Face ID). These are the features that Craft 4 didn’t have. Thus, offering security to business-critical sites.
  • Freeze out vulnerabilities: Craft 4’s security support ends in April 2026, meaning future security patches will only target Craft 5 and later. Waiting too long could leave your site exposed
  • Speed: Craft 5 is built for speed. New database handling and lazy eager-loading mean your pages load faster, your editors spend less time waiting, and your visitors stay longer
  • Growing with demand: Adoption of Craft CMS is climbing since 2023, with a 50 % surge in live sites using it, with Craft 5 growing fast among enterprise and high-traffic users.

Upgrading your Craft CMS website will provide you with long-term support, security, and easy accessibility to new features like nested elements, multi-site enhancements, and improved control panel usability. 

In this blog, we will cover the key differences between Craft CMS 4 and Craft 5. Also, we’ll discuss the steps for the Craft CMS 4 to Craft 5 migration. 

Key Differences Between Craft CMS 4 and Craft 5

Feature / Capability Craft CMS 4 Craft CMS 5
PHP Support PHP 8.0 / 8.1 PHP 8.2+
Security Features Basic login security Passkey support, native 2FA
Plugin Ecosystem Widespread support Actively shifting toward Craft 5-only
Performance Enhancements Standard loading Faster queries, lazy eager loading
Nested Elements Not supported Fully supported
End of Support April 2026 (for security only) Full ongoing support
Control Panel Improvements Stable and functional Cleaner UI, better field organization
Commerce Support Craft Commerce 4 Craft Commerce 5 (multi-store improvements)

 

Prerequisites & Preparation for Craft CMS 4 to Craft 5 Migration

It’s important to ensure your site is clean and stable before starting the Craft 4 CMS to Craft 5 migration.

This helps ensure the overall migration procedure is error-free and has minimal downtime. Let’s discuss the preparation steps that lead to a hassle-free and easy Craft 4 to Craft 5 upgrade. 

1. Update Craft 4 to the Latest Patch

Make sure the site is on the latest version of Craft CMS 4. It makes all the deprecations visible, and there is no critical change missing from previous minor releases.

syntax of Update Craft 4 to the Latest Patch

Afterward, check for deprecation warnings in the Control Panel. For this, click on Utilities → Deprecation Warnings. 

The Craft 5 will remove deprecations completely.

2. Audit & Update Plugins/Modules

Check if all the plugins used on your site are compatible with Craft 5. 

Some plugins may not yet have a Craft 5 version, or they might require a beta version for compatibility.

Tips:

  • Visit the plugin’s page on the Craft Plugin Store
  • Review release notes or GitHub repositories for Craft 5 readiness

Remove the plugins that are no more in use or not maintained and integrate other useful alternatives.

3. Verify Environment Requirements

Craft 5 has higher system requirements compared to Craft 4. Make sure your server or local dev environment supports the following:

Requirement Minimum Version
PHP 8.2+
MySQL 8.0+
MariaDB 10.4+
PostgreSQL 13+
Composer 2.2+

Run this command to check your PHP version

syntax of Verify Environment Requirements

If you’re using a local development tool like DDEV, Laravel Valet, or MAMP Pro, be sure they’re running PHP 8.2 or higher.

4. Backup and Set Up Local/Dev Environment

Never upgrade on a live site. Always use a local or staging environment first.

Steps:

  1. Pull the latest database from production
  2. Backup your entire project folder and database
  3. Set up a dev environment using tools like DDEV, Laravel Valet, or MAMP Pro.

Make sure the .env file reflects local settings and doesn’t point to live assets or services.

For example: 

syntax of Backup and Set Up Local/Dev Environment

Once these steps are in place, the project is ready to upgrade to Craft CMS 5.

d4d-logo

Need help dealing with plugin issues and server checks?

Let our Craft CMS experts handle the technical prep and compatibility checks for you.

3. Step‑by‑Step Craft CMS 5 to Craft 5 Migration Process

You need to make sure the upgrade is performed in a safe environment, like other updates, before you make your site live.

We will cover the step-by-step guide to upgrade your website from Craft 4 to Craft 5.

1. Pull the live database into the local environment

  • Sync the live site’s DB to the local environment
  • Tools to use: mysqldump, DDEV import, or hosting control panel export

syntax of Pull the live database into the local environment

2. Rebuild project config & clean temp files

It helps ensure that the configuration is up-to-date and clean.

syntax of Rebuild project config & clean temp files

3. Adjust .env DB charset and collation (MySQL only)

Modify database settings for utf8mb4 + utf8mb4_unicode_ci

syntax of Adjust .env DB charset and collation (MySQL only)

4. Update composer.json dependencies
  • Change the Craft CMS version to ^5.0.0
  • Update PHP version and plugins as needed

syntax of 4. Update composer.json dependencies

5. Run composer update & migrations

This runs the database migrations and updates all plugins.

syntax of Run composer update & migrations

6. Apply DB charset conversion (MySQL)
  • Remove charset overrides → php craft db/convert-charset

syntax of Apply DB charset conversion (MySQL)

This ensures Craft 5 uses the correct character set and collation.

7. Fix Bootstrap or File Permission Errors
  • If errors like “bootstrap.php not found” or permission denied appear:
  • Ensure correct file permissions on vendor/autoload.php and bootstrap.php
  • Typical fix:

syntax of Fix Bootstrap or File Permission Errors

Your site is now using Craft 5. If you started without any deprecation warnings, you’re almost finished with upgrading.

d4d-logo

Time to Upgrade From Craft CMS 4 to Craft 5

Our CMS development services ensure a smooth, error-free upgrade, from code cleanup to composer updates.

4. Post‑Upgrade Checks & Optimization

It’s vital to run performance checks and optimize queries once the site is upgraded. These tasks directly impact the speed of your site.

1. Test Front‑End & Control Panel
  • Visit the site’s front end and admin panel
  • Check pages, entries, fields, and assets
  • Make sure forms, user logins, and dynamic elements are working
  • Watch for missing fields or errors from outdated template logic
2. Handle Breaking Changes & Deprecations
  • Visit: Craft 5 Upgrade Guide
  • Review the changelog and note any removed or renamed APIs
  • Update any deprecated template code, plugins, or custom modules

syntax of Handle Breaking Changes & Deprecations

3. Redactor to CKEditor or Link Field Migrations
  • Craft 5 replaces Redactor with CKEditor by default
  • For rich text fields:
  • Manually change the field type in the Control Panel
  • Or use the terminal:

syntax of Redactor to CKEditor or Link Field Migrations

For the Typed Link field:

  • Replace with new Hyper plugin or built-in Link field
  • Update templates accordingly
4. For Commerce Users: Upgrade to Commerce 5
  • Set the version in composer.json:

syntax of version in composer.json:

  • Review product templates and APIs:
  • Product types, line item options, and cart logic may need updating
  • Full upgrade notes here: Craft Commerce Upgrade Guide
5. Performance & Query Optimization
  • Avoid slow templates by optimizing entry queries

syntax of Avoid slow templates by optimizing entry queries

5. Go‑Live Deployment

You can upgrade to Craft 5 as part of your regular deployment with little manual work. A fast and secure website with Craft CMS is only achievable when all settings are optimized and tested on staging first.

After upgrading and testing locally, follow these:

  • composer.json and composer.lock
  • Everything in config/project/
  • Any updated templates, config files, or modules

Deploy these changes to each environment, then run:

syntax of Deploy these changes to each environment

If you added temporary character sets or collation settings during the upgrade, remove them now. Then run:

syntax of emporary character sets or collation settings during the upgrade, remove them now.

This will apply Craft 5’s default settings to all database tables.

Final Thoughts

Upgrading to Craft 5 brings a wide range of benefits. It includes modern PHP support, nested elements, multi-store capabilities, and advanced AI tooling. These new features open opportunities for increased flexibility, speed, and security of your website. 

Additionally, following the step-by-step guide discussed above will help you smoothly upgrade your website from Craft CMS 4 to Craft 5.

Besides, you can seek expert assistance from Digital4design. The company specializes in Craft CMS 4 to 5 migration with a skilled team that ensures a hassle-free Craft 5 upgrade with minimal downtime.

So, what are you waiting for? Leverage the new functionalities offered by Craft CMS.

Mukul Singh

Mukul is the mastermind behind Digital4Design, where he turns ideas into incredible websites that don’t just look good, they work flawlessly. With over 10 years of experience, he’s passionate about creating digital solutions that stand out and deliver results. As the founder, Mukul wears many hats, but his favorite part is collaborating with clients to bring their vision to life while ensuring every site is smooth, stunning, and user-friendly.

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts