26May2011

Upgrading Drupal 7.0 to 7.2

Today the Drupal team launched an upgrade to the 7.x line. This upgrade is 7.2 and includes the 7.1 release, according to the Changelog page, there are 244 bug fixes on 7.2 and none related to security issues, that's a good sign.

Like any major upgrade, it's a best practice to test it before installing on the online version, using a qa environment or a local installation. In my case, I'm using my local machine with sources and data syncronized with online version.

For that I'm using a very simple aproach (I'm using a shared hosting, there is no many options), using MacFusion for mounting the remote filesystem as a unix volume, and synchronizing sources using rsync. For the database I'm using backup & migrate module

www.pauloamgomes.net - local and online structure

So before any update, locally, I get all stuff synced, update/upgrade the necessary stuff like the core sources, modules or templates, test if all ok and than i do the update/upgrade stuff on live version. It takes maybe 20m for all process and for a simple site, like mine, is very reasonable. With some minor effort this process can be easily automated using drush, maybe when I get some free time.

Resuming, my steps are the following:

First, using rsync I get all local files up to date with online version

# rsync sources
rsync -avz /Volumes/www.pauloamgomes.net/www/. /www/. --exclude ".DS_Store" --exclude ".localized"  --exclude ".hg" --exclude ".gz"

Using backup & migrate make a database export on online version:

Backup & Migrate - quick backup

Again with backup & migrate, on local version I do a database restore:

Backup & Migrate - restore

Now that local is synced with online, I do the necessary upgrade to 7.2:

# get the upgrade
wget http://ftp.drupal.org/files/projects/drupal-7.2.tar.gz

# uncompress it
tar xfzv drupal-7.2.tar.gz

# copy all files to my document root
cp -r drupal-7.2/. /www/.

And the update.php script: http://local.pauloamgomes.net/update.php, if no errors I do some validations on all pages and work is done.

Finally, since there no errors ocurred, the upgrade steps are done remotely on live installation.

Tags: