How to upgrade Drupal 9 to Drupal 10

By Fernando Katsukawa, 7 January, 2023

This tutorial works if you are using drupal/core-recommended dependencies in the current Drupal 9 project.

Before continue on this tutorial, I highly recommend to you to read the Important Update information available in the Drupal 10.0.0 release page, here.

 

Upgrade the Drupal 9 to Drupal 10, fortunately is much more easy than upgrade from Drupal 7 to Drupal 8 or 9, however it still needs high Drupal knowledgment from the developer that will do. It requires to check the Drupal 10 requirements, some (pre and pos) upgrade steps to make sure that everything was upgrade successfully. See below the topics that I believe that is crucial to any developer to upgrade your current Drupal 9 project to the latest Drupal 10 version.

Requirements

First of all, please check if your hosting environment have all the necessary requirements from Drupal 10, here.

Pre Upgrade Steps

To upgrade from Drupal 9 to the latest version of Drupal 10, you will need to execute some steps before, that are:

  • Update your Drupal 9 website at least to the 9.4.4 version, as mentioned here.
  • If your website is using CKEditor 4, upgrade it to the CKEditor 5 (must be at least in Drupal 9.4.4 as above, as mentioned here).
  • Check your current Drupal 9 installation if it is ready for Drupal 10. For this you can use the Upgrade Status module, which is very good. By composer you can run:
composer require drupal/upgrade_status
  • Check also if you are using any other package that have dependency of Drupal 9, and remove or update it. To check package dependencies for Drupal 9, you can run the command below:
composer why drupal/core
  • When you have your Drupal 9 installation 100% ready for Drupal 10, you are now ready to follow with the Drupal 10 upgrade. But first, probably would be a good idea to:

Remove the Upgrade Status module, if you installed in the step before, because the version (8.x-3.18), that I'm writting today is not compatible with Drupal 10:

composer remove drupal/upgrade_status

Remove the drush dependency if you have it in your composer.json, by running the command below:

composer remove drush/drush

Upgrade step

Then finally you can run the command to upgrade to the latest Drupal 10 version using the drupal/core-recommended:

composer require drupal/core-recommended drupal/core-composer-scaffold drupal/core-project-message --update-with-all-dependencies

Post upgrade steps

Now you can re-install the drush again to your project, by running the command:

composer require drush/drush

Run the database update command using drush as below:

drush updb -y

Export the new configuration changes:

drush cex

Clear the cache

drush cr

Test your website.

About the Author

Profile picture for user fkatsukawa

Fernando Katsukawa is a certified senior backend developer, who have been worked with Drupal in the last 12 years and counting...

Saved your precious time? Use the cup below to buy me a coffee!
buy me a coffee - cup