Upgrading Drupal 10.3 to Drupal 11

This is my notepad for efforts to do this upgrade.

First install the upgrade_status module:
composer require 'drupal/upgrade_status:^4.3' 

Upgrade drush:
composer require drush/drush:^13

Keep exporting your database because installing any module can throw an unrecoverable error.

When you uninstall a module, first do it in the Extend/Uninstall menu, and then using composer remove drupal/module_name

Finally, Zurb_Foundation released a D11 patch, so I can go ahead and try the upgrade to D11.1. 

But this requires putting a patch section in composer.json

    "extra": {
       "patches": {
           "drupal/zurb_foundation": {
               "temporary patch": "https://git.drupalcode.org/project/zurb-foundation/-/merge_requests/30.patch"
           }
       },

I also had to install the basic theme that is required by Zurb: https://www.drupal.org/project/basic.

Had to upgrade OpenSUSE Leap 15.6 to php > 8.3. Need repository
https://download.opensuse.org/repositories/devel:/languages:/php:/php83/openSUSE_Leap_15.6/

NOTE: https://forums.opensuse.org/t/apache2-will-not-start-with-php-8-3-x/180238/10

Also, be sure to update settings in /etc/php8/apache2/php.ini and on your hosting php version in Control Panel.

First, I will save everything.

Copy composer,json and composer.lock just to be sure you can unwind.

https://www.drupal.org/docs/upgrading-drupal/upgrading-from-drupal-8-or-later/how-to-upgrade-from-drupal-10-to-drupal-11

  • I had to remove the classy theme from composer.json
  • composer require 'drupal/google_tag:^2.0'
  • composer require 'drupal/metatag:^2.1'
  • composer require 'drupal/poll:^2.0@alpha'
  • composer require 'drupal/gtranslate:^3.0' -W --no-update

  Problem 1
   - Root composer.json requires drupal/core-composer-scaffold ^11, found drupal/core-composer-scaffold[11.0.0-alpha1, ..., 11.x-dev] but the package is fixed to 10.4.2 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
 Problem 2
   - Root composer.json requires drupal/core-project-message ^11, found drupal/core-project-message[11.0.0-alpha1, ..., 11.x-dev] but the package is fixed to 10.4.2 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
 Problem 3
   - Root composer.json requires drupal/core-recommended ^11, found drupal/core-recommended[11.0.0-alpha1, ..., 11.x-dev] but the package is fixed to 10.4.2 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.

 # composer prohibits drupal/core 11.1.2
drupal/core-recommended    10.4.2 requires         drupal/core (10.4.2)
drupal/core                11.1.2 requires         symfony/console (^7.2)
drupal/recommended-project -      does not require symfony/console (but v6.4.17 is installed)
drupal/core                11.1.2 requires         symfony/dependency-injection (^7.2)
drupal/recommended-project -      does not require symfony/dependency-injection (but v6.4.16 is installed)
drupal/core                11.1.2 requires         symfony/event-dispatcher (^7.2)
drupal/recommended-project -      does not require symfony/event-dispatcher (but v6.4.13 is installed)
drupal/core                11.1.2 requires         symfony/filesystem (^7.2)

Note that core 10.4.2 did not appear anywhere in my composer.json file, but it was in composer.lock. Replacing all 10.4.2 in the lock file with 11.1.2 did not help.

So, after many tries, I had to do the following:

  • Uninstall GTranslate and zurb_foundation (the above patch did not work in Composer).
  • Remove composer.lock
  • Then
    # composer update -W 
    worked!
  • But I had to reinstall zurb_foundation manually (from the tar file), apply the patch, and leave it out of composer.json until the fixed version is released.
  • But, trying to update the database gave me
> PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /srv/www/htdocs/www/web/core/lib/Drupal/Component/Utility/NestedArray.php on line 343
> PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 32768 bytes) in /srv/www/htdocs/www/web/modules/contrib/cleantalk/src/CleantalkFuncs.php on line 640
  • So I uninstalled cleantalk.
  • I also uninstalled tour, which was removed from core. I had previously installed it, but did not need it.
  • At this point, drush updb worked and I could rebuild the cache.
  • Reinstalling cleantalk worked.
  • I had to patch GTranslate to remove this error printed out with drush ws:
foreach() argument must be of type array|object, string given in
Drupal\gtranslate\Plugin\Block\GTranslateBlock->build() 
(line 371 of /srv/www/htdocs/www/web/modules/contrib/gtranslate

In D11, Slick slideshow no longer works, so you must switch to splide to get the slideshow to work! But splide also gave problems, so I switched to Views Vanilla Javascript Slideshow (vvjs).

On jamesrome.net migration

For modules with a patch, I decided to remove them from composer.json, patch them, and when the d11 version is released, I will add it back to composer.json.

  • I was unable to get the update to work with zurb_foundation. installed.
    • I moved zurb_foundation to themes/custom, patched it for D11, and renamed it to zurb_custom in zurb_foundation_info.yml
  • I then uninstalled zurb_custom and installed Olivero as my theme.
  • composer update -W then worked.

However, when I moved the site to A2hosting.com, I found that they did not have the required version of Mariadb. They moved my 4 sites to servers that had the required version for no charge.


On my second site:

I had to remove chi-tek code generator drupal/allowed_formats, drupal/video_embed_media

then composer update -W worked


On my third site:

  • I had a lot of trouble with views_base_url which did not have a D11 version. Removing the module removed most of my site content! Luckily restoring the database restored the data. Back up often!
    • But the patch was trivial and I did it manually. composer update -W still complained. I removed it manually from composer.json.
  • But the statistics module also gave issues. Remove statistics before you start the update since it was removed from core in d11. You can then reinstall the stand-alone statistics module.
  • I had to install the Bartik theme and then remove in on the Appearance page.
  • Then in the themes/contrib directory, I removed bartik, classy and seven.
  • I also had to uninstall and remove drupal/allowed_formats.
  • I still had issues with things needing Drupal 10.3.4, so in composer.lock, I changed all of these to 11.1.

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and email addresses turn into links automatically.
  • Lines and paragraphs break automatically.

Comment

  • Allowed HTML tags: <b> <h2>
  • No HTML tags allowed.

The comment language code.

CAPTCHA

Enter the characters shown in the image.

This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.