Picture of a sign reading "Upgrade. Maintain speed." Next to a highway.

Quickie: A Bash Script for Open Atrium Upgrades

Our webhost, Acquia, provides security updates as a service through Remote Administration Automation.  This means that, when a security update is released for any contrib modules used in any of our sites, Acquia is immediately aware and immediately begins the process of updating said module.  Once they have the module’s updated version committed to our git repository, they can either automatically deploy it or simply notify us of the update so we can review it and deploy it ourselves.

In a Standard Drupal Core instance, this is great!  It cuts the estimated 25% Full Time Employee (FTE)’s time to keep Drupal up to date down to ~5% (my own rough estimate).  However, with an instance of Open Atrium, this automated-update process can cause problems.

With Open Atrium, even with critical security updates, the proper process is to hold off on individual module updates and wait for an official release of the Open Atrium project.  This is because there may be other changes to OA modules/themes that are now required due to the contrib module’s update.

This means that when the automated process detects an available update for a module in OA, it will apply the upgrade onlto the contrib module.  If notified, Acquia will wait for the proper OA release and perform the update with it but it often takes some back and forth correspondence and may introduce extra delay in getting that update to production.  When the update contains a patch for a critical security issue, that may not always be tenable and manually upgrading may be the only option.

My colleague has produced a series of commands that, when executed from a level above your docroot will update OA, keeping your sites directory intact as well as all your dotfiles, robots*.txts, and, in our case, our simplesaml configuration:

I took the liberty to script this for ease-of-use in the future:

Or here’s the upgrade script on PasteBin.

Below line 28, you can add a line for any custom directories that may be unique to your installation.  For example, we have a simplesaml setup for single-sign-on and favicons_etc here.

The usage is as follows (first copy/create the script in the directory above your docroot):

For example, if you wanted to upgrade to OA 2.63 and your docroot directory’s name is “docroot”, you’d copy the script to a level above your docroot and execute:

$./upgrade_oa.sh docroot https://ftp.drupal.org/files/projects/openatrium-7.x-2.63-core.tar.gz

You can find the URLs to OA releases on the Open Atrium project’s releases page.

Leave a Reply

Your email address will not be published. Required fields are marked *