Drupal 10: Updates can be easy

Eli Stone / Aug 29, 2023

Drupal 10 officially came out on December 14, 2022 and at Amazee Labs we were excited to get all of our projects running this latest version. Over time we’ve optimised the update process to lower our risks, increase our knowledge and improve our success rate – let's talk about how we do that!

The Long Game

It is always exciting to be the first to try something new, however, your clients might not enjoy it as much if something they were used to doing no longer works as expected. To lower the likelihood of coming across unknown issues we like to wait a few months once a major release is dropped. This is to allow the dust to settle a bit more and hope that some of the commonly found issues are fixed before you have to be the developer to report them.

That said, we will still use the latest versions locally on our own machines to try and get an idea of what kind of changes we expect to see coming and if there is anything we need to get ready for ahead of time.

The Team

At the moment Amazee Labs makes use of a team of people whose sole job it is to focus on updates – not just major core but security patches and minor updates. 

In the past, we didn’t have a dedicated team for this and would allow any developers available to work on updates. Even though that did work, knowledge about updates gets lost even when shared – a developer might not be aware of an issue or remember it being talked about as lots may have happened between their last updates.

To optimise the process we now use a core update team to keep track of this, they see the updates all the time and knowledge can be kept to a smaller group and isn’t lost as easily.

Start Small…

We work with a lot of projects, these range from what we would class as small/simple websites that are maybe a few pages and a webform or two; all the way through to massive projects that have commerce, expose parts of their data via APIs and have data pulled into their site on a daily basis.

We start our updates on the smaller projects, as the name implies these sites will have fewer modules to update and therefore less to test but are useful for checking out our workflow and finding the more common issues when testing.

Having said that, if you only have big projects, updates can still be done, you will just have to test more.

If at any point the task seems too daunting though, you don’t have to navigate the update alone, our dedicated team is always here, ready to lend a helping hand – just reach out.

The Processes

This is the same no matter the size of a project. We break down our process into two parts:

1. Drupal 10 Ready

2. Drupal 10 Update

Drupal 10 Ready

This is about getting your site ready for Drupal 10. It involves getting your modules up to date, making sure your current core version is as close to the next major version as possible, removing any deprecated modules and adjusting deprecated code.

Sounds like a lot of work, luckily there is a helpful tool for this: 

https://www.drupal.org/project/upgrade_status 

This Drupal module once installed will give you a new UI and allow you to scan all your modules to check how ready you are for Drupal 10.

Then we break down the steps the module has given us:

Update to the latest version of Drush
Something to note here is that generally updating Drush has no side effects, unless you have lots of automated migrations so be careful to test these afterwards.

Remove uninstalled modules
Bit of cleanup to not update modules that are not in use anymore.

Contrib modules updates
This will involve hopefully upgrading your modules to the latest version, however, in some cases you will be required to apply patches or even make the fixes yourself.

Custom module updates
Upgrade status really helps out here, listing all the things that you need to change, generally this might be just updating core_version_requirement to add ^10, but can be more complex.

Resolve deprecated or obsolete core extensions installed
Some of the deprecated modules are easy to remove, just simply check if they are in use. For example the color module, others like CKEditor to CKEditor 5 range in complexity.

The CKEditor 5 module does a good job of helping you but there are still some plugins that are not ready to work with it.

Here you have two options:

1. Work with the modules to find a fix or workaround

2. Make use of the now contrib CKEditor module

The other issues involve the theme, but we will talk about this in more detail in Part II of our blog.

Once you have made your way through the list the upgrade status should show that you are 100% ready for Drupal 10, so now you're on to the final step.

Drupal 10 Update

This final step feels like it should be as simple as any other core update, and in some cases it might be, although from our experience it requires a little more nudging to get everything happy with Composer.

Assuming you have applied patches to modules to get them ready for Drupal 10, you will want to check out https://github.com/mglaman/composer-drupal-lenient. This module allows you to basically white list certain modules so you don’t get hit with “This module is not ready for Drupal 10” before the patch is to be applied to make it ready for Drupal 10.

For us the steps to upgrade to Drupal 10 are normally as follows:

1. Install https://github.com/mglaman/composer-drupal-lenient

composer require mglaman/composer-drupal-lenient

2. Add any modules to the allow list

composer config --merge --json extra.drupal-lenient.allowed-list '["drupal/token"]'

3. Chicken & egg problem, set all the updates without updating

composer require drupal/core-recommended:^10 drupal/core-composer-scaffold:^10 drupal/core-dev:^10 --no-update

4. Update everything

composer update -W

5. Run updates

drush cr -y && drush updb -y && drush cex -y

6. Ready to test the site

Summary

It seems only fair to mention that in theory the above is all you will need to update to Drupal 10, but there are some more stubborn modules out there that can make the process more tricky. We will follow up on this blog post in Part II with more details about some of the issues we faced when updating and how we resolved them – don’t forget to follow us on Twitter or LinkedIn to make sure you don’t miss out on the rest of the blog series when it comes out later this year!

Overall updating to Drupal 10 can seem scary or even tricky, but we feel if you follow a good process and use the help modules, a site can be ready for testing in only a few hours.