If I compared the situation from this January when I upgraded some first webs running on their own servers or virtual servers to Drupal 9 and the current situation from October/November I would sum it up into the following observations:
- With content websites and company presentations I encountered the only module that didn’t have Drupal 9 version. Nice Menus. Good that I don’t use it with my new projects. A repair required only an edit of the info file and one detail in a code when I had to replace the drupal_render() function for a service.
- Upgrade itself is even a little more painless than it was before.
- A little bit more complicated is a situation with websites that haven’t been built around Composer, in my case some webs built with early Drupal 8. It is ideal to convert them to Composer and upgrade afterwards.
- On a hosting you will come across a problem with an older version of the MySQL database or MariaDB. Ideally if there will be a new database created on a newer engine.
- Sometimes the Upgrade Status reports an older database version probably because of a problem with its version numbering.
- An alternative solution for a situation when you cannot upgrade a database is the module installation MySQL 5.6 and MariaDB 10.0 database driver for Drupal 9. The process with Composer and also without it and a description of a following edit in settings.php are clearly described on the module page.
How to upgrade Drupal 8 to Drupal 9
The itinerary of a successful upgrade process is actually identical to the one I already described in my post in January. The first thing is to install Upgrade Status. I would like to stop here for a minute. A problem will occur on webs only accessible via FTP, where you are not used to using Composer. Without it the module cannot run. I recommend a web copy on a local, the module installation launch there via Composer and then copy it to FTP.
Tip: I have lots of webs built with Composer which have hosting accessible without SSH, with FTP only. Updates and commands of Composer I carry out on my computer (or via some git workflow) and synchronize to FTP with the tool Phploy.
Upgrade Status will find out for you whether the used modules are compatible with Drupal 9. In many cases this will force you to upgrade for example some module versions. Then check system demands on a server – PHP version, Apache and a database engine. Beware of that because if you don’t fulfil the conditions you won’t be able to launch update.php after the upgrade and finish the upgrade itself.
Thanks to this auxiliary module you will also see what is necessary to edit in settings.php, I personally have the most often come across the setting $config['sync'], which needed to be rewritten to $settings['config_sync_directory'].
Also it can scan your modules and visual themes, find incompatible code pieces and help you with correcting them. Carefully here, you cannot launch it on some webs with strict security measures. Then just hope you have an access via SSH and you can carry it out with a command for drush (drush upgrade_status:analyze). Otherwise you will have to make a local copy if you don’t have it already.
Before the upgrade process itself uninstall Upgrade Status module as well as the needed drupal/core-dev.
Now you should go through standard upgrade steps:
- In the folder /web/sites/default set up entry for files *settings.php a *services.yml.
- Call the command composer require drupal/core-recommended:^9.0.0 drupal/core-composer-scaffold:^9.0.0 drupal/core-project-message:^9.0.0 --update-with-dependencies --no-update
- If you did not turn off and uninstall Upgrade Status beforehand, then also composer require 'drupal/core-dev:^9' --dev --update-with-dependencies --no-update
- Then the simple composer update
- Update the database, ideally from the command line via drush updatedb -y
- Make sure that in composer.json you got "drupal/core": "^9.0.0”,
- Cancel the entry rights to the files mentioned in the point number 1.
The first complication might come when launching update.php when you’ll see a notification that the server doesn’t meet some minimal requirements or that you will have to edit settings.php. Really, do not underestimate the preparation.
The second one might appear after going through updates when you go to a web title page and you will see a white page or an error notification instead. Add to your settings.php the following line with which you will turn on error warning viewing. That should give you a hint where a problem lies:
$config['system.logging']['error_level'] = 'verbose';
Was it worth it to wait?
In conclusion, there are much less problems with incompatible modules than in the beginning of the year and virtually nothing should make Drupal 9 upgrade impossible for you. Depending on a web status and a hosting that it is running on, my (to this date) completed upgrades took between 30 minutes and 8 hours – that’s for the case of old FTP webs.
In my opinion this situation is definitely better compared to the past when upgrades from five to six or six to seven were being made. In the future it will again be just as smooth.