Skip to content

Latest commit

 

History

History
85 lines (64 loc) · 3.38 KB

migration-8-plus.md

File metadata and controls

85 lines (64 loc) · 3.38 KB

Migrations from 8.x to any latest major version

Notes about migrating a Drupal 8.x or 9.x website to 10.x+. The same approach works for any future migration from a Drupal 8+ project.

Commands

# Install upgrade_status module
composer install --dev
composer require drupal/upgrade_status --dev

# Check custom modules for deprecated code
composer require phpunit/phpunit:"7.*" --dev
composer require mglaman/drupal-check --dev
drupal-check -d web/modules/custom

# Enable module and test upgrades
drush en -y upgrade_status
drush upgrade_status:analyze --all

# If no module need to be updated test core upgrade
# Every project not compatible will disallow the upgrade in composer
rm -rf vendor web/core web/modules/contrib composer.lock
composer require drupal/core-recommended:^10.0

# If there are available 10.x readiness patches apply them with composer
# If there are not patches available create them manually or
# download these modules in modules/custom folder
# Otherwise you can use the drupal-lenient endpoint. See https://dgo.to/3240297
composer config repositories.lenient composer https://packages.drupal.org/lenient

# If there are modules or themes to fix use rektor or drupal-check to fix them
# Install drupal-check globally
composer global require mglaman/drupal-check

# And finally... install
composer install

# Take a db backup
...

# Run db updates
drush updb

# Check drupal logs for warning and fix them

# Disable upgrade_status
drush pmu -y upgrade_status

Tips

  • Modules that do have patches for 10.x compadibility require 8.x core so they cannot apply through composer! You can download these modules as 'custom' and apply there any patches.
  • For the problem above you can also use the Drupal lenient endpoint so you allow patches to be applied. See https://dgo.to/3240297 and https://github.com/mglaman/composer-drupal-lenient.
  • You may need dev versions for several modules.
  • Some of the major drupal modules may not have 10.x support.
  • If you do the same process for other environments (eg from dev to stage) don't forget to run drush updb after the first composer install. Otherwise the drush cim may cause errors like The base theme stable cannot be uninstalled, because theme classy depends on it.

References

Articles

db updates example

-----------------------------------------------------------
  Module           Update ID
  migrate_drupal   Add revision ID to entity reference translation migrate_map tables
  system           entity_revision_metadata_bc_cleanup
  system           uninstall_classy
  system           uninstall_entity_reference_module
  system           uninstall_simpletest
  system           uninstall_stable