Updating Drupal on OpenShift

The first security update for Drupal since I started this blog was released a while back, and I negligently dragged my feet in actually applying it here because I was unsure how to do so in OpenShift. It turns out to be quite simple, but it did take me a while to figure out all the steps so I figured I would write them down here to help anyone else doing the same thing.

  1. First, ssh in to your OpenShift application: rhc ssh blog (find the rhc command in the rubygem-rhc package on Fedora). Note that the login requested here is your full email, not your shortname.
  2. Once you're in, create a directory where you can save backups. Unfortunately OpenShift doesn't give you write access to the application's home directory, so the default path used by drush won't work: mkdir ~/.drush/backups

    ~/.drush should already exist and be writable by your user. You could use any other writable directory you find, but this one seemed the most logical to me.

  3. Enter the php directory: cd php
  4. Put your Drupal site into maintenance mode like you would for any other Drupal update.
  5. Use drush to update your Drupal site: drush --backup-dir=~/.drush/backups up
  6. Take your site back out of maintenance mode and the warning messages about an available security update should go away.