Updating Drupal Contrib Modules on Pantheon.io
Recently, we were helping a client get their Drupal 8 website set up for hosting on the Pantheon platform. They would eventually take over updates of both core and contrib modules for the site.
While gathering resources to help them with the process, we found that, although Pantheon had documentation for Drupal core and contrib updates via Composer and/or Git, it didn’t have the process outlined for updated contrib modules via the Drupal administration GUI.
The solution was to write our own guide for this process. Afterwards, I felt others could use this same outline to assist with their own workflow, hence this blog post.
This guide describes the process for performing updates on contrib modules for a Drupal site hosted on the Pantheon platform. While this guide details the process for Drupal 8, the same workflow can be applied to Drupal 7 or WordPress sites.
Preparing the Site for Updates
Once you have navigated to your project’s Dev page, ensure the Development Mode is switched to SFTP, not Git.
SFTP mode enables the website’s code to be altered in an online dev environment, as opposed to Git mode where you must pull the repository to your local environment to alter any code.
Once the Development Mode has successfully changed, navigate to the Development Site.
Updating Modules via Admin GUI
In your development site, go to the Extend tab (located in the administration navigation menu) and go to the Update page.
(You can also navigate to the Extend page to view all currently installed modules)
Once there, you can select the modules you’d like to update. It is important to check the recommended version number against the already-installed number.
General rule-of-thumb is if a module’s recommended release minor version number is incremented by 1 from your installed version, it will be safe to update it. If the minor version number is any more than one, or if the major version has changed, it’s good practice to check the release notes on drupal.org (a link is provided next to the Recommended Version number, as shown in Figure 4).
Figure 4 – Drupal 8’s Update page.
Once you’ve selected the modules you’d like to update, click the ‘Download these updates’ button and let Drupal do the rest. After they have updated successfully, you’ll be shown the following message.
Some modules will require an update to their database table(s). Review these updates, apply, and then run them.
Once the database updates are complete, you’ll be shown a log of any messages, warnings, or errors.
You can now go back to the main site and test a few pages to ensure nothing has changed.
Assuming there were no issues in the update process, you can exit the development site and go back to the project dashboard on Platform. In the Dev tab, you’ll notice your code changes ready to commit to Git. You can add a commit message, then switch the Dev site from SFTP back to Git mode, which will stage your commit to push to the Test environment.
In the Test tab, you’ll see a highlighted section detailing what commits are ready to be tested against the live site. All the checkboxes should be selected, and you can add a Deploy Log Message if you’d like.
Pantheon will perform the options selected, and you’ll then be able to test the updated code against the live database and files by clicking the Visit Test Site button.
After checking for issues on the Test site, you can navigate back to Pantheon and to the Live tab. The process here is the same for deploying from Dev to Test.
Check a few pages one last time on the Live site to ensure there are no problems.