From 00d6afb3ae4bbb21340bc330b3d75ceee9750469 Mon Sep 17 00:00:00 2001 From: Eirik Stanghelle Morland Date: Fri, 28 Feb 2025 10:34:09 +0100 Subject: [PATCH 1/3] More instructions for d10 --- d10-upgrade.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/d10-upgrade.md b/d10-upgrade.md index f2a6fb9..163c228 100644 --- a/d10-upgrade.md +++ b/d10-upgrade.md @@ -1,5 +1,57 @@ # Upgrade from Drupal 9 to Drupal 10 +## Getting the environment ready + +- Make sure the project is using drush 10 +- Make sure the project has at least version ^1.0 of all phpstan related modules (`mglaman/phpstan-drupal`, `phpstan/phpstan-deprecation-rules`, `phpstan/extension-installer` and `phpstan/phpstan-phpunit` +- Make sure the project has upgrade status enabled +- Make sure the project has `drupal/drupal-extension` version 4 or higher. + +## Upgrade all of the contrib modules + +It is extremely important to upgrade all of the contrib modules following a specific pattern: + +- Upgrade the module with composer +- Run database updates (if any) +- Export config (if it differs) + +To make this as easy as possible, you can use this one-liner that runs all of those commands and asks for the module name: + +``` +clear && echo "What is the machine name of the contrib module (i.e commerce, or address)?" && read -r MODULE_NAME && composer update drupal/$MODULE_NAME && drush updb -y && composer export +``` + +Some modules would require you to also update them with dependencies. In which case you would just append that at the right place in the one-liner: + +``` +clear && echo "What is the machine name of the contrib module (i.e commerce, or address)?" && read -r MODULE_NAME && composer update drupal/$MODULE_NAME --with-dependencies && drush updb -y && composer export +``` + +Proceed to upgrade each and every one of them, until there are no incomatible contrib modules on the upgrade status page. + +If the project is set to use a site schema, remember to commit site schema files along with composer and config changes. + +## Upgrade Drupal core + +First we do this: + +``` +composer require 'drupal/core-recommended:^10' 'drupal/core-composer-scaffold:^10' --update-with-dependencies --no-update +``` + +Then, hopefully, if we are lucky. This should now work: + +``` +composer update "drupal/core*" "symfony/*" composer/installers drush/drush --with-dependencies +``` + +If it does not work, use this command to try to troubleshoot: + +``` +# Replace 9.5.1 with whatever is the latest drupal core. +composer why-not drupal/core 10.4.3 +``` + ## Common errors and how to fix them ### Problem with PHPUnit tests and ignoreFile From 9520fb2d88c288e318d4dd3e767d7b2928fe162a Mon Sep 17 00:00:00 2001 From: Eirik Stanghelle Morland Date: Fri, 28 Feb 2025 10:38:51 +0100 Subject: [PATCH 2/3] Update d10-upgrade.md --- d10-upgrade.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d10-upgrade.md b/d10-upgrade.md index 163c228..8d91291 100644 --- a/d10-upgrade.md +++ b/d10-upgrade.md @@ -2,7 +2,7 @@ ## Getting the environment ready -- Make sure the project is using drush 10 +- Make sure the project is using drush 11 - Make sure the project has at least version ^1.0 of all phpstan related modules (`mglaman/phpstan-drupal`, `phpstan/phpstan-deprecation-rules`, `phpstan/extension-installer` and `phpstan/phpstan-phpunit` - Make sure the project has upgrade status enabled - Make sure the project has `drupal/drupal-extension` version 4 or higher. From 2c3522b931f4291d48939cb25485091602d275f2 Mon Sep 17 00:00:00 2001 From: Eirik Stanghelle Morland Date: Mon, 3 Mar 2025 07:38:04 +0100 Subject: [PATCH 3/3] Update d10-upgrade.md --- d10-upgrade.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d10-upgrade.md b/d10-upgrade.md index 8d91291..d3a8b12 100644 --- a/d10-upgrade.md +++ b/d10-upgrade.md @@ -2,7 +2,7 @@ ## Getting the environment ready -- Make sure the project is using drush 11 +- Make sure the project is using drush 12 - Make sure the project has at least version ^1.0 of all phpstan related modules (`mglaman/phpstan-drupal`, `phpstan/phpstan-deprecation-rules`, `phpstan/extension-installer` and `phpstan/phpstan-phpunit` - Make sure the project has upgrade status enabled - Make sure the project has `drupal/drupal-extension` version 4 or higher.