Upgrading Drupal 8 to Drupal 9: The real-world experience
We have discussed prerequisites and changes in following article:
Drupal 9 is coming!
First of all, we dumped database to have a backup. Just in case.
To start, we had to upgrade to latest version of Drupal core and modules in 8.x family. In our case it was Drupal 8.9.0. We changed composer.json file and ran update scripts.
Above are lines changed in composer.json.
composer update drupal/core drupal/core-dev --with-dependencies
After that we installed and enabled Upgrade Status module. This is handy tool to check readiness for upgrade. In fact, this module saved our web and a lot of troubles.
composer require --dev 'drupal/upgrade_status:^2.0'
drush en upgrade_status
After that, we were ready to see how ready we are for the next major version of Drupal. We were not. PHP version was the only green thing in the list. Since it is an older web, we had to upgrade MySQL version (MariaDB in our case) and upgrade Drush version.
Drupal system readiness for upgrade
So we did. Docker helped us with database and Composer helped with Drush.
composer require 'drush/drush:^10.0'
With system ready, we were ready to check all modules and themes, both custom and contrib. So we selected all checkmarks and pressed “Scan selected”. We ran into timeout after 60 seconds. And again, and again. We had to change the attitude. We used Drush one more.
drush upgrade_status:analyze --all
Status Upgrade terminal output
We were luckier this time. Whole script passed and we had our results. In a loooong console output. Luckily, all the data could be displayed in Drupal admin zone too.
Status Upgrade warning for custom theme
Custom modules and theme needed only cosmetic fix. To add core_version_requirement into info file. It tells Drupal core that it can be used with Drupal core 8 and 9. But contrib modules gave us headache. Lot of them using deprecated methods even in the latest versions. Lot of them generating warnings and errors. In that very moment we knew that Drupal 9 is no go for us yet. It is not so surprising since we have tested it mere days after Drupal 9.0.0 release, but it was still a disappointment.
Status Upgrade in Drupal admin UI
Detailed Drupal 9 incompatibility output
Some of the modules had new alpha or beta releases ready. For most modules it is not what you want to use. For some, it is unfortunately the only release. Some did not have even beta releases ready for Drupal 9.
In the end, result of upgrading from Drupal 8.8 to 9.0 was upgrade to 8.9. Without any problems. It’s also something. Upgrading to Drupal core .0 versions is usually not without problems in bigger systems.
We have to wait for modules to be ready for Drupal 9 and maybe we will be forced to replace some of them one day.