With Drupal 9 having reached its end of life (EOL) on November 1, it’s time to start planning for an upgrade.
For those already operating on Drupal 9, upgrading to Drupal 10 is not as daunting as earlier upgrades and promises to be easy, reflecting the software’s overall trend towards smaller, more incremental upgrades and faster iterations. According to Drupal, you should "completely update your Drupal 9 site to the most recent version of the modules and theme(s), before updating to Drupal 10."
The deprecated code will be based on Drupal 9 moving into Drupal 10, but there are ways to search your system and update the specified code block.
The first thing to do is to install the drupal/upgrade_status module in your project and enable it. composer require drupal/upgrade_status
&& drush en upgrade_status
, if you have drush installed else go to admin > modules and search for upgrade status and install it. After the module is enabled, go to Admin > Reports > Upgrade Status. This page should contain all the upgrades and code changes necessary before your site can be upgraded to Drupal 10.
Steps to upgrade Drupal 9 to Drupal 10
Migrating from Drupal 9 to Drupal 10 can be easy or can be difficult depending on the project you are involved in. Yes, because every site is different and may present its own unique challenges.
These are the following steps to migrate from Drupal 9 to Drupal 10.
drupal/module_name': '^1 || ^2'
, and you can have version 1 still installed while on Drupal 9. Once you install Drupal 10, version 2 of the module will be installed by composer.composer require drupal/core-recommended:^9.5 drupal/core-composer-scaffold:^9.5 --update-with-all-dependencies
Now let's look at the tricky part. Drupal 10 has some specific things we have to do to allow us to upgrade to drupal 10.
mglaman/composer-drupal-lenient
before attempting to upgrade. Otherwise these modules will create a dependency problem. After the installation, you need to declare the Drupal 9 modules which should be treated as Drupal 10 modules. For example, to allow drupal/token to be installed run:composer require mglaman/composer-drupal-lenient
composer config --merge --json extra.drupal-lenient.allowed-list '["drupal/token"]'
^11 || ^12
, we use this because some module may not be version 12 compatible.composer remove drupal/console --no-update
core/jquery.once
if it does exist update it to use core/once
because jquery.once
is removed from Drupal 10composer.lock
file(although its not a best practice), delete vendor folder then run composer install which will install from the composer.json
file and create a new .lock file..php
file to get the issue fixAfter all these are done and ready for upgrade, you can run this command
composer require 'drupal/core-recommended:^10' 'drupal/core-composer-scaffold:^10' 'drupal/core-project-message:^10' --no-update
If drupal/core happens to be part of the composer.json file, remove it. This dependency is included in drupal/core-recommended and may cause problems. If you have drupal/core-dev installed, you can run this
composer require 'drupal/core-dev:^10' --dev --no-update
Now,let us test perform the update with the --dry-run option: this allows us to see if the update will runs smoothly or might encounter some errors.
composer update --dry-run
If you encounter any errors, walk through the process to resolve them. Resume the process when the errors are resolved, run the update with dependencies to update any transitive module.
composer update -W
Don’t forget to run drush updb
and drush cex
after the upgrade. This means you should run the upgrade on top of an installed and functioning D9 database.
If you have a custom theme that is based on classy,seven or stable then don’t forget to install them as contrib themes - composer require 'drupal/[module_name]'.
You should uninstall and remove upgrade status after the upgrade process.
Pathauto has an issue with some config files so, if you have Pathauto installed then you need to update some configs by hand. Namely pathauto.pattern.[name]
config files have had their selection_criteria plugins updated. For example node_type becomes entity_bundle:node. or try the following command
drush eval 'include_once(DRUPAL_ROOT . "/modules/contrib/pathauto/pathauto.install"); pathauto_update_8108()'
In summary the whole update process for a site can be very difficult and ranges from project to project. It could have different modules installed, with some even locked to specific dev versions, as well as heavily patched old major versions of modules which needed to be upgraded. You walk through these steps and iterate through if need be to get your upgrade completed.
20 employees from Ramsalt Lab had the opportunity to attend DrupalCon in the city of Barcelona. Read our top recommendations from the conference!
Vi søker en visjonær og handlekraftig daglig leder som kan ta vårt utviklingsfirma til nye høyder! Er du en strategisk leder med solid forretningsforståelse og en sterk lidenskap for teknologi og innovasjon? Da vil vi høre fra deg!
The European AI Act came into force on 1 August 2024, bringing new rules and regulations for artificial intelligence within the EU. If you use AI on your website or for content-creation it is important to understand how these changes could have an impact.
We have gathered some reasons why Drupal could be a better choice for your needs.