Upgrading

Upgrade Procedure

Here is a sample procedure for upgrading a Drupal site.  This may vary from one site to another.  This general process can be used when upgrading Drupal core, upgrading contributed or customer modules, or migrating theming and other changes from a Development or Test environment to a Production environment.

Typically the upgrade should be performed in off-hours.  For a site used mostly during regular business hours, a Friday evening may be ideal as you would have all weekend to recover from a disaster without a major service interuption.

Another option is to do the upgrade in the early morning hours on a weekday, with customer represntatives available to QA the site after the upgrade, made possible by their planning an early arrival to work.

The estimated outage period should be estimated and communicated to the customer.

It is critical to have a fall-back plan in place in case of unforseen problems.
 
1.  Turn off all caching and dump the cache.
2.  Create a script to dump the db (this is to be sure we have a dump readily available, with no reliance on external db
backup processes).  Create a script to import the db, which would only be used in the event is was necessary to abort the upgrade and perform a roll-back.
3.  Dump the db.
4.  Do a full SVN (Version Control) Checkout into a new directory at the same level as the current production directory --or-- download and install a fresh copy of Drupal into a new directory, deleting the /sites directory. Copy any directories needed from the current production directory into the new directory, e.g. /files /sites etc.  Be sure to set the file permissions (chmod) and file owner (chown) if running the site on a Linux based server.
5.  Put the site in off-line mode.
6.  Rename the production directory.  This is better than making a tar because a roll-back of the file system can be made by simply renaming the directory back to its original name.
7.  Rename the SVN Checkout / Drupal New Install directory to the production directory name.
8.  Run update.php
9. Implement any settings required by the upgrade, for example updating views or other module configuration settings using the Drupal interface.
10.  Return site to on-line mode.
11.  Turn caching back on.
12.  Run Status Report - check for exceptions.