Drupal on Pantheon (upgrading from Drupal 10 to Drupal 11)


Table of Contents

Tools

You will need git, composer, php.  Use the links below to install or use UMD Virtual Workspace which has the necessary tools installed.  

  1. Install git
  2. Install php 8
  3. Install composer

Create a SSH key certificate to checkout your site code from Pantheon.

From a terminal window, run the command: 

ssh-keygen -b 2048 -t rsa

Unless you have reason to change it, leave the default location of ~/.ssh/id_rsa as is. If the command says the key already exists, you can either overwrite it, or continue to the next step with your existing key.

A passphrase is recommended to provide greater security, but can conflict with tools that cannot handle them.

Once the files are created, you will need to copy the contents of id_rsa.pub to your clipboard.

cat ~/.ssh/id_rsa.pub

type .ssh-add ~/.ssh/id_rsa

Cut and paste the certificate into Pantheon, this is done under your account page at https://dashboard.pantheon.io/personal-settings/profile

personal settings

 

Upgrade Process

Upgrade Prep

Create a Multidev environment to test the update (Optional, but recommended) 

Multidevs are development environments for teams that allows a developer to fork the entire stack (code and content), work independently, then merge the code changes back into the master. Each forked branch will have its own separate development environment, including database and files.

Check out the site project repository to your local machine

  1. Click on the 'Connection Info' on the top right of the site dashboard.
  2. Copy the line under "
    • If when attempting to check out the repo you receive the message "Connections Fail With: no matching host key type found. Their offer: ssh-rsa", please see the Pantheon SSH Key doc in the resources section below for troubleshooting steps.

Git by default checks out the main 'origin/master' branch, which is attached to the dev version of your site, if you are using the multidev development method, run the following commands to check out your multidev branch:  'git pull' then 'git checkout --track origin/my-multidev-branch-name' without the ' marks.

Top

Install and enable the Upgrade Status module version 4.

This module will show site readiness for a Drupal upgrade (example screenshot from the module page). If you already have the module installed, make sure you are using version 4 as versions below 4 can cause issues with the upgrade.

  1. On your local repo, run the following (if using multidev, make sure you have switched to its branch):

composer require -W --ignore-platform-reqs drupal/upgrade_status:^4

    • add the changes, commit them and then push them from your local repo to the site repo
    • The upgrade status module will now be added to your Pantheon site
  1. Enable the module from the Extend menu on your Drupal site
    drupal menu focusing on the extend option
  2. Find the upgrade status page under Reports" from the toolbar, or by visiting yoursite.umd.edu/admin/reports/upgrade-status and running the report, ex:

Uninstall or upgrade modules, or fix issues identified by the upgrade status module report.  Most likely this will involve uninstalling incompatible/deprecated modules, updating modules to newer versions that are compatible with Drupal 11, and updating environmental components.  Custom modules or modules with custom code may have to be individually reviewed.  Uninstalling and upgrading modules, and updating environmental components will be described below.

Top

Uninstall modules

NOTE: Uninstall modules from the Drupal website interface first before removing the code.  If the module code is removed first, the Drupal site will still have a record of the module, but will not be able to find its code, and will throw errors.

  1. Find the 'Uninstall module' tab under 'Extend" from your sites admin toolbar
    ""
  2. uninstall old, unneeded, or deprecated modules from the list, this will remove all that modules content/settings
  3. For deprecated themes, look under the 'Appearance' tab
    • Note: if you encounter issues getting the 'Stable' theme uninstalled, DIT can run a quick Terminus command to help
  4. Once a module has been uninstalled, the code for the module can be removed from your site repo
    • Modules can be removed with the command: 

composer remove drupal/module_name

Another important step; any module uninstall actions done via the Drupal site UI must be repeated on all site environments (dev, test and live). Uninstalling a module is a content change, which do not promote upward from the development environment like code changes do. 

Alternatively, you can uninstall a module on the live site, and then copy the database back to the test and dev environments.  Copying the database to the lower environments will bring the module uninstall with it, as well as refresh the content.  Copying the database from the live environment can be found on the Pantheon dashboard under Database/Files from the left subnav of each environment.

Top

Updating modules

Modules can be updated from your local repo with Composer with the command:

composer require drupal/module_name or composer require drupal/module_name:^x if you need a certain version, replacing x with the new version.  

Next you will need to run the following command to have composer process your change, and make sure the update got the right version:

composer update

""

External Data Source

The Drupal module External Data Source is used to pull in information for the news articles on UMD Terp sites.  The contrib module does not have a Drupal 11 release at this time, so the UMD Terp vendor has forked its code, and included a Drupal 11 compatible version as a custom module in the Drupal 11 version of UMD Terp.  The Drupal 11 Composer upgrade process below will remove the contrib module, and pull in the custom version, you should not need to make any changes related to the External Data Source module manually.

Update Pantheon system environmental values

The quick version is below, for a more detailed explanation we have this KB article

  1. within the pantheon.yml file in the root of your site repo, add or update the following lines to these values:

php_version: 8.3
database:
  version: 10.6

  1. Commit your pantheon.yml changes to your site repo, and push them to your site. 
  2. Check that your site is working with the updated PHP version, and that the Upgrade Status screen reports the updated PHP version.

Promote your Upgrade Status work

Make sure that your module un-installation work has been mirrored to all all environments, and promote your code updates to test and live so that everything is in sync.

Top

Drupal core and UMD Terp Drupal 11 update

From your repo (or the multidev branch on your local repo if you are using a multidev), run the following:

composer require 'drupal/core-recommended:^11' 'drupal/core-composer-scaffold:^11' 'drupal/core-project-message:^11' 'pantheon-systems/drupal-integrations:^11' 'umd_digital/umd_terp:^11' 'umd_digital/umd_terp_base:^11' -W --no-update

This will set your composer.json to Drupal 11, as well as the versions of Pantheon and UMD Terp.  If you are not using the UMD Terp theme, you can remove the segment 'umd_digital/umd_terp:^11' 'umd_digital/umd_terp_base:^11'

If you have a "require-dev" section of your composer.json, you can either change that to 11, or delete it.

Notes:

Run the 'composer update' command

composer update

Fix any issues identified by composer update run.  If there are issues found with module versioning, check the module project page to see if there are newer or updated versions that may have fixes.  You may need to update to module versions that list they are compatible with Drupal 11.

Commit and push

Once you get a clean "composer update" run, add your changes, commit changes, and push to server

Review the site.

Review the site status page, check for errors and updates that may need to be done. You may need to run database updates on your site.

Once all issues are remediated, promote the code to Test and Live

Top

UMD Terp and the UMD Design System

This update brings most of the UMD Terp elements to the UMD Design System standard, designsystem.umd.edu.  Some notes from that transition are as follows:

Additional Resources

Top