Hello Drupal folks! I’m back after a week of vacation and I wanted to start my first post back by a look ahead a few weeks to the Drupal 9.1 release.
I know, I know, Drupal 9.0 JUST CAME OUT (and it did). Blink and you’ll miss these releases. You can read more about the cycle here. But TLDR a new minor version of Drupal comes out roughly every 6 months. This also means that Drupal 8.8.x will lose security support when 9.1 releases.
Where are you today?
As with many of my other posts related to doing an update… Updating to Drupal 9.1 is going to be varying levels of difficult depending on where you are today on your platform.
Drupal <7: there is no upgrade path! You’ve got to rebuild. More on this here.
Drupal 8.x: there IS an upgrade path, but I would suggest upgrading to Drupal 9.x first
Drupal 9.x: there IS an upgrade path and it should largely be NBD.
Assuming the third scenario (you’re already on Drupal 9.x) then this is a pretty “minor” update. Does that guarantee it will go smoothly? NO! Does it mean it should be pretty safe? YES! I would, as always, recommend you do some testing.
Testing the Update
To test the update, there are a few things you’ll need to do. The most direct is to update your composer.json’s definition for drupal/core to allow ^9.1, then run composer update drupal/core --with-all-dependencies. It is out of the realm that this will fail.
If it fails, then use the composer why-not drupal/core ^9.1 command to understand what in your codebase is blocking you. It could be that you will need to update something else (e.g. Acquia Lightning recently made an update to allow folks to safely update to Drupal 9.1).
So, two scenarios:
you have a package blocking your update and you have to update that package (or those packages) to update to Drupal 9.1.
you have a package blocking your update and even the most current version of that package doesn’t work with or support Drupal 9.1.
In scenario 2, there are a couple of things to consider. First, you should check on Drupal.org for the project and make sure there is an issue open (or recently closed) that addresses the issue. If so, great! If not, I would open one ASAP. Second, you can “fake” your way to Drupal 9.1 as a test case.
Composer allows you to alias “something” as “something else.” For instance…
"drupal/core": "9.1-alpha1 as 9.0.7"
This will install the Alpha, but for dependency calculation it will treat drupal/core as being 9.0.7 instead of the alpha1. I very strongly do not recommend doing this for reals, but doing it as a test case is A’OK.
The next thing to do after actually updating the code should look familiar. Check for database updates. Check for configuration changes. With Drush, this can be done in 2 commands:
drush updb -y
drush cex -y
I personally recommend testing both the clean installation use case (which might be useful for your continuous integration processes) AND you site update use case (meaning you already have a database with your existing content, configuration, etc. locally where you can run the updates).
I also hope you have automated testing that you can execute against the site after you’ve performed the update.
From here, it’s largely a waiting game. Once Drupal 9.1 comes out in early December, assuming you’ve safely done the update during this early access phase (and haven’t found problems) then you can safely pull the trigger and do the update!
If you haven’t, everything I’m posting here is still going to be relevant once Drupal 9.1 comes out in December. The biggest reason to do some testing now? It’s always useful to find problems well in advance. I actually found a problem a couple of days before one of the Drupal 8.x minor releases in 2019 because of doing testing just like this. The core team rushed a fix and it was added to the stable release (after being found in the beta). The more sites that test the update, the more safe and secure the update is going to be!
Happy updating.
An overview of all the things I’ve been trying / testing to get ready for PHP 8.1.