Performing major Drupal revision upgrades

In Drupalese, upgrade is typically used to refer to the process of migrating to the next major release branch of Drupal, as in upgrading from Drupal 6 to Drupal 7. The related term, update, refers to the process of performing minor stability or security updates for modules and core within in the same major release branch of Drupal, as in updating from Drupal 6.19 to Drupal 6.20. This guide covers major revisions upgrades only. 

These notes were compiled in the process of upgrading from Drupal 6.20 to 7.0-rc3. Links to reference resources can be found below.

This guide takes a unique sort of approach to the process. It is a step-by-step for migrating a single site from a Drupal 6 multi-site base installation to a Drupal 7 multi-site install. Backups are performed according to best practices, but the Drupal 6 multi-site installation remains in its own folder, while the Drupal 7 installation exists in its own (another) folder on the server. Depending on your hosting situation, a redirect or DNS change is necessary to have the URL for your site point to the new folder. In this case, the originating Drupal 6 folder on the server was drpl6, and the new folder for the Drupal 7 installation was drpl7. Also, the Drupal 7 multi-site base installation was first set up, with a place holder default site and a development site using a sub-domain for its URL, before migrating any Drupal 6 sites.

Do not perform the upgrade process on a live site! Create backups! Note any errors along the way (and report them on Drupal.org in the appropriate issue queue)!

  • Create an inventory of your current contributed modules and themes
    • The list of modules and themes in use on your site will help you determine if an upgrade is appropriate at the time, as some of the modules you use may not yet be available in the next major version.
    • Keep in mind that over 40 contributed modules in Drupal 6 were ported into core for Drupal 7.
    • Certain modules may have specific upgrade instructions, so it is advisable to check the project pages and their associated issue queues for your modules. This is especially true for modules which define content access permissions.
    • You may find, very quickly, that you will not perform the upgrade at this point due to a lack of a corresponding module in the next branch of Drupal, there is no update path for the module, etc.
    • The Upgrade Status module is very helpful in this step, and throughout the upgrade process with the Upgrade Assist sub-module.
    • Ensure that all contributed modules have an update path for the next major release branch.
    • Disable and uninstall unused modules and modules which you plan to abandon (possibly, if there is no upgrade path for the module). Remove the folders for unused modules and themes from the sites/all/themes and sites/all/modules folders.
  • Download and unpack the latest release of Drupal in the next major release branch
    • Read UPGRADE.txt in the base folder of the new version of Drupal
  • Update Drupal core, all contributed and custom modules, and themes to their most recent releases within the current Drupal branch
    • It is only possible to upgrade from the most recent release of Drupal within your current branch to the next major release branch. In other words, if your Drupal site is version 6.17, then you must update to version 6.20 before upgrading to Drupal 7. Likewise, it is only possible to upgrade to the next major release branch after your current installation, so if you are running Drupal 5, then you must first upgrade to Drupal 6 before upgrading to Drupal 7.
    • Check for available updates on your current Drupal site at: admin/reports/updates
  • Test your current site after updating core and contributed modules, and before upgrading
  • Using FTP or command line, upload the core files and folders for the new version of Drupal to a folder on your server
    • If there is not a corresponding version of a module for the new version of Drupal, then copy the folder for the module to the sites/all/modules folder
  • Login is as user 1, a.k.a. the super-user, on the current site
  • Verify that your Drupal core and modules are up-to-date
    • admin/reports/updates
  • Put your site into maintenance mode
    • admin/settings/site-maintenance
  • Backup your site files and database
    • Use either the Backup and Migrate module, or a direct backup of your database (command line or a GUI like PHPMyAdmin), or both methods, to create a backup of your database.
  • Switch to the default theme (Garland for Drupal 6) for your current site
    • admin/build/themes
  • Check that the administration theme is set to use the system default (site) theme (so that it is using the default theme for Drupal)
    • admin/settings/admin
  • Disable all contributed and custom modules
    • admin/build/modules
    • This can take a while...
  • Clear your caches
    • admin/settings/performance
  • Copy the current site database to a new database (or use the current database and rely on your backups)
  • Copy the site folder and file backup to the sites folder in the new Drupal installation
    • Make sure that your backups (yes, plural) are fully completed, organized, verifiable, ready for restoration, etc.
  • Delete default.settings.php from the site folder
  • Ensure that settings.php is writeable
    • When updating to the next major branch of Drupal, update.php must be able to make the necessary changes to settings.php for your site.
  • Ensure that modifications to .htaccess and robots.txt are replicated in the corresponding files in the the new Drupal installation
    • If you made changes to either the originating Drupal .htaccess or robots.txt files, then you should make those exact same changes in the corresponding files in the new Drupal installation. Do not simply copy the .htaccess and robots.txt files from the old Drupal installation.
  • Change your server set up so the URL for the site points to the folder for the new Drupal installation
    • This is applicable if there are separate folders in your server hosting root for the old and new Drupal installations. If the installations are on separate servers, then a similar change will need to be made so the URL points to the new install.
  • Run update.php for core updates
    • You must be logged in as the super-user (user 1) to run update.php
  • Download and install new branch versions of contributed and custom modules
  • Backup the site database and files
  • Run update.php again
  • Enable the new contributed and custom modules
  • Re-run update.php
  • Test, test, test
Drupal version: 
Tags: 

Comments

Add new comment