Wednesday 17 December 2014

Update your Drupal site from one minor 7.x version to another minor 7.x version

This post contains the information of upgrade.txt that is relevant to a minor Drupal core upgrade. To see the full upgrade.txt that was formerly posted here, go here: http://drupal.org/node/1285892

Introduction

This document describes how to update your Drupal site from one minor 7.x version to another minor 7.x version; for example, from 7.8 to 7.9, or from 7.6 to 7.10.

First steps and definitions:

  • If you are upgrading to Drupal version x.y, then x is known as the major version number, and y is known as the minor version number. The download file will be named drupal-x.y.tar.gz (or drupal-x.y.zip).
  • All directories mentioned in this document are relative to the directory of your Drupal installation.
  • Make a full backup of all files, directories, and your database(s) before starting, and save it outside your Drupal installation directory. Instructions may be found at http://drupal.org/upgrade/backing-up-the-db
  • Always try an update or upgrade on a test copy of your site before applying it to your live site. Even minor updates can cause your site's behavior to change.
  • If you used an install profile make sure to keep it when performing step 3 (remove all old core files). If you remove your install profile your site will begin throwing "undefined index" errors. (http://drupal.org/node/1186196).

Upgrade problems

If you encounter errors during this process:
  • Note any error messages you see.
  • Restore your site to its previous state, using the file and database backups you created before you started the upgrade process. Do not attempt to do further upgrades on a site that had update problems.
  • Consult one of the support options listed on http://drupal.org/support
  • Also consider consulting the #drupal channel on IRC
  • Upgrading your Drupal Core files using drush may also result in "undefined index" erros. http://drupal.org/node/1170362
More in-depth information on upgrading can be found at http://drupal.org/upgrade

Minor version upgrades

To update from one minor 7.x version of Drupal to any later 7.x version, after
following the instructions in the First steps and definitions section at the top of this file:
  1. Log in as a user with the permission "Administer software updates".
  2. Go to Administration > Configuration > Development > Maintenance mode. Enable the "Put site into maintenance mode" checkbox and save the configuration.
  3. Remove all old core files and directories, except for the 'sites' directory, the original install profile in the 'profiles' directory and any custom files you added elsewhere.
    • If you made modifications to files like .htaccess or robots.txt, you will need to re-apply them from your backup, after the new files are in place.
    • Sometimes an update includes changes to settings.php (this will be noted in the release announcement). If that's the case, replace your old settings.php with the new one, and copy the site-specific entries (especially the lines giving the database name, user, and password) from the old settings.php to the new settings.php.
  4. Download the latest Drupal 7.x release from http://drupal.org/project/drupal to a directory outside of your web root. Extract the archive and copy the files into your Drupal directory.
    • On a typical Unix/Linux command line, use the following commands to download and extract:
      wget http://drupal.org/files/projects/drupal-x.y.tar.gz
      tar -zxvf drupal-x.y.tar.gz
    • This creates a new directory drupal-x.y/ containing all Drupal files and directories. Copy the files into your Drupal installation directory:
      cp -R drupal-x.y/* drupal-x.y/.htaccess /path/to/your/installation
    • If you do not have command line access to your server, download the archive from http://drupal.org using your web browser, extract it, and then use an FTP client to upload the files to your web root.
  5. Re-apply any modifications to files such as .htaccess or robots.txt.
  6. Run update.php by visiting http://www.example.com/update.php (replace www.example.com with your domain name). This will update the core database tables. If you are unable to access update.php do the following:
    • Open settings.php with a text editor.
    • Find the line that says:
      $update_free_access = FALSE;
    • Change it into:
      $update_free_access = TRUE;
    • Once the upgrade is done, $update_free_access must be reverted to FALSE.
  7. Go to Administration > Reports > Status report. Verify that everything is working as expected.
  8. Ensure that $update_free_access is FALSE in settings.php.
  9. Go to Administration > Configuration > Development > Maintenance mode. Disable the "Put site into maintenance mode" checkbox and save the configuration.

No comments:

Post a Comment