upgrade page D8 to D9

On this page I'm going to show my upgrade experience from Drupal 8 to Drupal 9 for this site.

I use the theme Mayo. However, there is no D9 version of this. I have adapted the current version so that it works under D9 and ^ 8.8. I posted something about this under the issues of Mayo. However, upgrading causes problems, but that will be explained later

First of all we are going to make a backup of the site and the database.

Next we will import this site on a local web server. Some adjustments in the .htaccess (turn off https) and settings.php.

(in this the trusted_host_patterns are provided with a #)

The site is then started locally. It functions!

First we will install update_status. THIS MUST WITH COMPOSER due to dependencies.

At cmd level we go to the docroot directory (the place where composer.json is located of the website. Here I run the following commands

$ sudo composer install --dev

$ sudo composer require 'drupal / upgrade_status: ^ 3.0'

I forgot this "chown -R www-data: www-data on the local site"


The upgrade_status module is now installed and must be started via the local site. Once started, it can be updated to the latest version in the usual way.

Via reports and upgrade_status you can see an overview of all modules and the like and whether they are suitable for D9.

I am now at 79%.

Some modules have to be updated manually, such as honeypot and webform to version 6.0.0. Do not forget to run update.php after every manual code replacement of a module.

Now scan in upgrade_status again the modules / themes that are not yet correct and if they are on fix manually, look at the problems to see what is still wrong and solve the problems.

Scan again to see if the problems have been resolved correctly.

With me it is now at 100%.

There may still be problems, but nothing. I understood that these can be ignored.

Previous attempts have shown me that a number of actions still need to take place.

1) with theme MAYO it is not going well because of base theme: I set this to false in mayo.info.yml Also make sure that other custom themes are provided with base theme: false, even if they are not the default.

2) After the upgrade, update.php needs a sync dir to be defined in settings.php. THIS IS DIFFERENT IN D9 ie $ settings ['config_sync_directory'] = '/ var / www / syncdir'; and create this syncdir, best outside the docroot and make www-data its owner.

3) uninstall the module upgrade and remove the module from the / modules AND / modules / contrib as well. Do NOT do this via composer, because it will remove dependencies that I have no insight into yet. This is not relevant to the test upgrade.

Now the upgrade.

First of all, a number of rights must be set

sudo chmod 777 sites / default

sudo find sites / default -name "* settings.php" -exec chmod 777 {} \;

sudo find sites / default -name "* services.yml" -exec chmod 777 {} \;

and now the update itself (I had to do everything with sudo)

sudo 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

and finally

sudo composer update

now run update.php (or do this via drush updatedb). If you get an error, chances are that 1 of the custom themes does not contain the base theme: false.

This went smoothly now

Now just reset the rights

sudo chmod 755 sites / default

sudo find sites / default -name "* settings.php" -exec chmod 644 {} \;

sudo find sites / default -name "* services.yml" -exec chmod 644 {} \;

So much for the first trial upgrade.

2nd trial upgrade

On the production environment, I made all the updates and tweaks required by the trial upgrade. Again made a backup and put it on the local server and started testing again. This showed that a module (scheduler) was not active (not even in production). This started and updated to a version that is compatible. (Also in production)

Then go through the whole process. The upgrade went without a hitch. I'm going to go through the process again, now without the upgrade_status story.

3rd trial upgrade.

The upgrade went without a hitch.

soon the production environment will go. Here I cannot do it with composer but via softaculous.

Production update.

First of all make a backup of the site and database. Then open the rights to the 3 files in sites / default and default. Now start the update with softaculous. Goes without problems. Start from softaculous update.php.

It works, the production site runs under Drupal 9.

Via Status report it appears that 1 more adjustment is needed to remove a $ settings that is no longer needed in D9.

Now there are 3 sites to convert, 1 of which has been converted from d7 to d8 in the past.


All sites have been converted to Drupal 9 without any problems.

Now ev