Upgrading the system

1. Overview

From time to time the Drupal software will need to be upgraded to later versions in order to apply security patches, fix bugs and deploy new functionality. Upgrading does not cater for moving to a new major version, for example, from Drupal 6 to Drupal 7, this is referred to as migration.

2. Instructions

  1. First get the new Drupal software.

    ~$ wget https://ftp.drupal.org/files/projects/drupal-X.xx.tar.gz

    or if the security certificates are not updated

    ~$ wget https://ftp.drupal.org/files/projects/drupal-X.xx.tar.gz --no-check-certificate


  2. Remove the files you don't need from the public_html directory.


  3. Rename the files you need.

    ~$ mv ~/public_html/.gitignore ~/public_html/.gitignore.old
    ~$ mv ~/public_html/.htaccess ~/public_html/.htaccess.old
    ~$ mv ~/public_html/php.ini ~/public_html/php.ini.old
    ~$ mv ~/public_html/robots.txt ~/public_html/robots.txt.old
    ~$ mv ~/public_html/sites ~/public_html/sites.old


  4. Unpack the files from the tar.gz file to the public_html directory.

    ~$ tar --strip-components=1 -xzvf ../drupal-X.xx.tar.gz -C ~/public_html

3. Patch method

In this method the changes are identified between the current source and the new source. This enables the administrator to update only the changed files rather than overwriting the entire file system.

  1. Create a working directory (eg. drupal).

    ~$ mkdir drupal; cd drupal


  2. Create the folders for the current and new versions.

    ~$ mkdir drupal-7.69
    ~$ mkdir drupal-7.70


  3. Unpack the source to the respective directory for current and new versions.


  4. Create the patch file containing the differences.

    ~$ diff -Naur drupal-7.69 drupal-7.70 > drupal-7.69-to-drupal-7.70.patch
  5. View the differences.

    ~$ grep diff drupal-7.69-to-drupal-7.70.patch
  6. Replace only the changed files on the production site.


Back to help on administration