Upgrading Drupal 9.5 to Drupal 10—Still not easy

 

Once again, it was a real struggle to update this site from Drupal 9 to Drupal 10. It took over a week. Why?

  • The change in CKEditor from 4 to 5 caused me several retries and great grief until I figured out what was required.
  • Composer does not recognize patched modules, which requires multiple kludges to fix.
  • The upgrade_status module itself installed things that prevented the upgrade.
  • Some modules that claim to be D10 ready are not.
  • Some modules that are really needed are not yet updated for D10, requiring work-arounds.
  • Some modules have D10 versions that do not work with D9.5. You will have to uninstall them and reinstall after the upgrade. This may ruin some parts of your site.

The steps to take

  • Install upgrade_status module to give hints at what needs upgrading
  • Update or remove modules. This is a two-step process: First uninstall the module using Extend/Uninstall, and then using composer remove.
    • If your site predates using composer, reinstall all modules using composer.
    • Remember, FIRST uninstall the module in Extend/Uninstall, and THEN use composer remove to remove it from composer.json. Themes must be uninstalled in Appearances, and also uninstalled using composer.
    • NOTE: paypal_payment cannot be successfully removed using just the GUI. I think the following works:
      • In the GUI, uninstall payment, currency, plugin, currency, and finally paypal_payment
      • composer remove drupal/paypal_payment drupal/currency drupal/paypal_payment drupal/plugin
  • If some modules need patches for D10 compatability
    • Install cwegans patch module: composer require cweagans/composer-patches
    • Install https://github.com/mglaman/composer-drupal-lenient
      composer config minimum-stability dev
      composer require mglaman/composer-drupal-lenient
      • Modify composer.json to list the patched modules
        composer config --merge --json extra.drupal-lenient.allowed-list '["drupal/token"]'

"patches": {
    "enable-patching": true,
    "drupal/simple_image_rotate": {
          "Rector patch": "https://www.drupal.org/files/issues/2022-07-18/simple_image_rotate.2.1…"
     },

     "drupal/superfish": {
           "rector patch": "https://www.drupal.org/files/issues/2023-01-18/3299991-drupal-10-compat…"
      }
},

"drupal-lenient": {
"allowed-list": ["drupal/superfish", "drupal/simple_image_rotate"]
}
 
In order to remove CKEditor4, you must remove the things that it depends upon. They can be reinstalled later (but some only work with CKEditor4).
  • Remove video embed WYSIWYG from text formats & editors.
  • Uninstall video_embed_WYSIWYG, media, field
  • Remove CKEditor (4) from all text formats & editors. (replace with None)
  • Remove upgrade_status module after having used it. (It does not upgrade properly)
  • Remove panelbutton (and colorbutton if there)
  • Remove CKeditor (4)
  • Remove module_missing_message_fixer
  • Update drush:
    • composer require 'drush/drush:^11' --no-update
  • Also, remove or install depricated modules or themes that are no longer in core:
 (Currently using Removed core modules You must add the following contributed modules and reload this page.
 * Color [1]
 * Quick Edit [2]
 * RDF [3]
 These themes are installed on your site but are no longer provided by Core.
For more information read the documentation on deprecated themes. [4]

[1] https://www.drupal.org/project/bartik
[2] https://www.drupal.org/project/seven
[3] https://www.drupal.org/project/classy
[4] https://www.drupal.org/node/3223395#s-recommendations-for-deprecated-themes

After the update

 arx-e commented about a month ago

Combining instructions in the above comments the procedure* is the following:
* after having updated to Drupal 10.x and Bootstrap5 3.x

    Get the two themes from Drupal 9.4.8
    Copy the two themes in core/themes
    Edit the info.yml file deleting the line "hidden: true"
    Uninstall the two themes using Drupal interface at Appearance
    Now you can delete the two themes from the core/themes directory and everything should be fine	
  • Go back to text formats & editors and enable ckeditor5 for GUI formats
  • Change settings.php permissions back to no write: chmod 444 settings.php
  • Run a status report to find any errors.
  • Alas, keep checking patched sites for released versions, and update any modules with fixed version numbers.

Comments

Submitted by Sean on Tue, 11/14/2023 - 14:32

Permalink

"If your site predates using composer, reinstall all modules using composer."
I wonder if you could elaborate on this process? My installation of Drupal, which predates Composer, knows about 128 modules, but only 35 are listed in composer.json. Should they all be in there?

Yes, they should all be in composer.json. That is the only way to properly let composer do its thing. Go to the module site and you will find the composer command to install the module. Copy it and paste into the www (or public_html) directory. They run
drush en drupal/module_name
drush updb
drush cr
You can do the last step after all the modules have been re-installed. This will put the modules into your composer.json. too.

Of course, before updating, it is best to uninstall modules that you are not using. But be sure you not only uninstall them using Extend/Uninstall, but if you used Composer to install the module (it will be in composer.json), also uninstall it using
composer remove
and be sure that the module itself is gone.
Then go to the module site (which hopefully now supports Drupal 10) and install it using the composer commasnd on that site.
Remember that composer installs not just the module itself, but also the non-drupal modules that are needed to make things work.

Submitted by Johny on Sat, 11/18/2023 - 05:25

Permalink

I would definitely remove deprecated themes before the update (don't forget to uninstall them first on the appearance page!). Also Claro should be set as admin theme before the update, otherwise Drupal is using your normal theme as admin theme, which in my case was not able to display the appearance page, so I could only switch to Claro with Drush.

Also your normal theme should be prepared for the update:
https://jigarius.com/blog/drupal-10-deprecated-base-themes

Submitted by DOC on Fri, 03/08/2024 - 02:18

Permalink

Upgrading to Drupal 10 is a pain. Especially from 8.9. It has been a real task. The best way I have found to do it is to wipe the entire server, and load a fresh drupal 10.2 and then import the data base. I get to drupal 9.5, and I can not do the database updates. I get:
Status Details
Errors found
Removed core modules
You must add the following contributed modules and reload this page.
CKEditor
Quick Edit
RDF
These modules are installed on your site but are no longer provided by Core.
For more information read the documentation on deprecated modules.
Removed core themes
You must add the following contributed themes and reload this page.
Bartik
Seven
These themes are installed on your site but are no longer provided by Core.
For more information read the documentation on deprecated themes.

Yet, why would I have to add any of those, if they are deprecated. I changed my admin and frontend themes before running the 10.0 update, and I still can not get past the update page. I really hate to have to load a fresh 10.2 and then import everything. I really can not figure out why they made the upgrade to 10 so difficult.
Again, it the Error on the update.php makes no sense. "You need to add the following and reload" But, those modules and themes are deprecated, and not used.
How did you make it past that? Thanks for any help.

you can add them as "empty" modules/themes, and then **uninstall in the gui or with drush** before removing them with composer/upgraded drupal

if the files were removed without uninstalling a module/theme first, drupal still has references in all kinds of places (eg database, configuration etc)

i got round this by downgrading to 9.5, re-adding the missing modules, then uninstalling them properly (inc rebuild cache and update.php) then upgrading again. i did have a key/value warning one of these upgrades, but this shouldn't stop update.php and i managed to resolve that with drush.

Submitted by Sandra on Mon, 04/08/2024 - 07:13

Permalink

my process was to uninstall modules/themes in blocks, and i added a module current year during the upgrade as well
i used version branches that included an updated composer.json and composer.lock file, in addition to updates to theme/stylesheets and custom modules

check compatible modules with upgrade status

for 9.5 and d10 i used https://www.drupal.org/docs/upgrading-drupal/upgrading-from-drupal-8-or…

note that you'll want to make sure your php version is set to 8+ when upgrading to d10 and pantheon currently supports up to drush 11

eg
```
composer require drupal/core-recommended:9.5.11 drupal/core-composer-scaffold:9.5.11 drupal/core-project-message:9.5.11 --update-with-all-dependencies --no-update --dry-run

composer require 'drupal/core-dev:9.5.11' --dev --no-update --dry-run

composer require 'drush/drush:^11' --no-update --dry-run
```

for cke4>cke5 i converted all text formats, though on some sites you may also need to create some toolbar icons

process with drush commands

```

# backups!

terminus drush mysite.test state:set system.maintenance_mode 1
terminus drush mysite.test pm:uninstall swiftmailer email_attachment mandrill
terminus drush mysite.test pm:uninstall quickedit rdf color hal aggregator
terminus drush mysite.test pm:uninstall webform_icheck webform_jqueryui_buttons webform_location_geocomplete webform_toggles
terminus drush mysite.test pm:uninstall webform_location_places webform_jqueryui_datepicker

terminus drush mysite.test theme:uninstall bartik

# deploy 9.5

terminus drush mysite.test cr
terminus drush mysite.test updb

terminus drush mysite.test pm:enable ckeditor5 mailchimp_transactional webform current_year
terminus drush mysite.test theme:enable olivero claro stable9
terminus drush mysite.test cr

terminus drush mysite.test config-set system.theme admin claro
terminus drush mysite.test cr

# cke4 > cke5 text formats

terminus drush mysite.test pm:uninstall ckeditor
terminus drush mysite.test theme:uninstall seven
terminus drush mysite.test theme:uninstall stable

terminus drush mysite.test cr

# deploy 10

terminus drush mysite.test cr
terminus drush mysite.test updb
terminus drush mysite.test cr

terminus drush mysite.test state:set system.maintenance_mode 0

# deploy post-10-cleanup

terminus drush mysite.test cr
terminus drush mysite.test updb
```

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.