Skip to content

Instantly share code, notes, and snippets.

@esafwan
Last active March 1, 2021 20:55
Show Gist options
  • Save esafwan/bcf8393cd56cde9aabcb28293b8fa0d2 to your computer and use it in GitHub Desktop.
Save esafwan/bcf8393cd56cde9aabcb28293b8fa0d2 to your computer and use it in GitHub Desktop.
Update Drupal Thunder Distribution from Thunder Version 2 (8.x-2.53) to Version 5 (8.x-5.4) using Composer and Drush. Resolving issues, conflicts and version mismatches..

Updating Thunder Distribution(Drupal 8) from version 2 to 5.

Version before update:


Drupal core Version - 8.7.14 Thunder Version - 8.x-2.53

Expected version after update:


Drupal core Version - 8.9.5 Thunder Version - 8.x-5.4

Application folder structure:


LICENSE
README.md
composer.json
composer.lock
load.environment.php
bin/
config/
docroot/ (Drupal webroot)
scripts/
vendor/

Steps followed:


In application root folder, in which compose.json & vendor folder is Run the below command:

composer update

Change to docroot folder and run database updates via drush:

cd docroot drush updb

Note: In my case drush was in vendor folder and I ran the commandvendor/drush/drush/drush updb

The official documentation requires changes to composer. I didn't have to do it. Official Doc: https://thunder.github.io/thunder-documentation/update-2-to-3

Thunder moved the composer package under the thunder namespace, so remove the old package and a the new one.

composer remove burdamagazinorg/thunder composer require "thunder/thunder-distribution:~3.3" --no-update

You have to update composer now.

composer update

Optional Step: Thunder removed some modules from our codebase. In case you are using one of below mentioned modules please require them manually for your project.

composer require drupal/views_load_more --no-update

composer require drupal/breakpoint_js_settings --no-update

composer require valiton/harbourmaster --no-update

composer require drupal/riddle_marketplace:~3.0 --no-update

composer require drupal/nexx_integration:~3.0 --no-update

composer require burdamagazinorg/infinite_module:~1.0 --no-update

composer require burdamagazinorg/infinite_theme:~1.0 --no-update

If Facebook instant articles integration is used follow steps in official doc. I didn't need the same.

Official Doc: https://thunder.github.io/thunder-documentation/update-2-to-3

Pre-requirements for media update

First we should make sure that the latest drush version is installed.

composer require drush/drush:~10.0 --no-update

For me this didn't work. Drush was locked at 9x I proceeded to next step.

Run:

composer require drupal/media_entity:^2.0 drupal/media_entity_image drupal/video_embed_field:^2.2

The above step failed with the error saying drush should be at 9 and the expected version is ~10.0. I had to manually edit the lock file related to drush and edit the version to 10.0. I don't think this is the right way to go, but it did work for me.

After above step run the below command again:

composer require drush/drush:~10.0 --no-update

Then install media update again.

composer require drupal/media_entity:^2.0 drupal/media_entity_image drupal/video_embed_field:^2.2

After the above step is completed.

Run database update

drush updb

This time, I got a warning that all media related modules should be at 2x version to avoid future errors. The error message is as below:

[error] Before continuing, please make sure all modules that provide plugins for Media Entity (or depend on it) have their code updated to their respective 2.x branches. Note that you will probably need to revert to the 1.x branch of the Media Entity module if you want to uninstall existing plugin modules. The following modules provide source plugins and need to be upgraded: media_entity_facebook. The following modules depend on media entity and need to be either upgraded or uninstalled: media_entity_facebook. (Currently using Media Entity Please fix the error below and try again.)

To fix above error, run:

composer require drush/media_entity_facebook

After that again run:

drush updb

This time everything works without error.

After that clear cache:

drush cr

The above command caused error.

In BootstrapHook.php line 32:

Bootstrap failed. Run your command with -vvv for more information.

I opened the site in browser without error and saw update pending in the top toolbar. I had to goto that page and complete one remaining update. Site is working after the error. Tested content CRUD operations without error.

Cleanup codebase

Now the update is done and you can remove some modules from your project. composer remove drupal/media_entity drupal/media_entity_image

If I succeed to fix Drush, will update this doc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment