Upgrading drupal point releases

Upgrading drupal between major releases can be a bit of a problem as I found out when upgrading from v5.5 to v6.  However, upgrading point releases can be relatively easy.  Note that to keep the URL constant and place drupal in its own file directory I use a symbolic link.  Depending on your web server you might need to set your configuration to handle that.

The strategy I use is to:

  1. Backup the database first:  mysqldump -u user -p databasename > backupfile.sql.
  2.  Make a copy of the old drupal file directory into the new version file directory, e.g. for upgrading v5.5 to v5.11: cp -a drupal-5.5 drupal-5.1
  3. Untar the new package overtop the new version: tar xvzf drupal-5.11.tar.gz
  4. Replace the settings.php file with the old version: cp drupal-5.5/sites/default/settings.php drupal-5.11/sites/default/settings.php
  5. Replace the symbolic link to point to the new version: rm drupal; ln -s drupal-5.11 drupal

And voila! the site was upgraded with all the old stuff still available in case there was a problem and I needed to revert quickly.  Note that this will NOT work for upgrading between major revisions, only minor ones.