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
-
Back up files and database!!
-
Also back up composer.json so if the update fails, you can easily revert to Drupal 9.5
-
-
If Failed: Revert to old composer.json and run composer update to restore working D9.5 and try to fix things.
-
I had to uninstall Mailchimp, which had no D10 patches) and also had to run
composer remove drupal/webform_mailchimp
even though it was uninstalled and not in composer.json
-
After the update
-
Turn on CKEditor5
-
Be sure to install the Claro Administration theme and use it for Administration pages.
(Without this, I was unable to configure CKEditor5, and also, Extend did not display my modules.) - Fix the themes that are no longer in core:
- Either reinstall them to get rid of nag messages, or
- Do the following kludge from https://www.drupal.org/forum/support/post-installation/2022-12-18/how-to-uninstall-deprecated-themes
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
CKEditor 5 / video_embed_WYSIWYG
Great info. Were you able to get the video_embed_WYSIWYG plugin to work in the CKEditor 5?
Thanks!
No. https://www.drupal.org…
No. https://www.drupal.org/project/video_embed_field is for CKEditor 4 only. See
https://www.drupal.org/project/video_embed_field/issues/3311063
Best method for reinstalling modules?
"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…
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,…
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.
I would definitely remove…
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
Also Drupal console should…
Also Drupal console should be removed as it prevents some dependencies to be updated.
Upgrading from drupal 8.9 to drupal 10
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.
uninstall before removing
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.
Be sure to uninstall…
Be sure to uninstall CKEditor 4 before the update. Critical: before you do this, change all of your Text Formats to NOT use CKEditor, and to use plain text.
my process
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
```
The people who can migrate…
The people who can migrate d9 to d10 are 0.0010 procents from all drupal fans users. Yes this so sad.
upgrading drupal
how can we change from 8 to 9 it is giving trouble in drush
See https://blogs.jamesrome…
See https://blogs.jamesrome.net/d8-d9. What trouble? Be sure you are using the right version (and location) of drush.
Add new comment