Updating Drupal

Below is decribed the process to update the core of Drupal. Note that we are currently running Drupal-7.x.

Update of modules

Any time you update one or several Drupal modules:

  • Do it from the Administration page (do not update manually on the server !)
  • Access the https://gazelle.ihe.net/update.php page to apply database updates if required
  • Also access https://conformity.ihe.net/update.php and https://usecase-repository.ihe-europe.net/update.php

By not running the update script on all the installations, you take the risk to break one or several of the Drupal sites managed on this installation !

Update of Drupal Core

  1. Login on portal server and use drupal user
    $> sudo su drupal
  2. Download the latest release of Drupal, you will get the link to the tar.gz archive at https://drupal.org/project/drupal
  3. Untar the archive
    $> tar xvzf drupal-7.x.tar.gz
  4. Backup the current drupal folder and its databases (drupal also hosts https://conformity.ihe.net and https://usecase-repository.ihe-europe.net), move both files to the /home/drupal/backups folder
    $> tar cvzf drupal-currentdate.tar.gz drupal-7.x
    $> pg_dump --username "gazelle" --format custom --blobs --verbose --file drupal-currentdate drupal
    $> pg_dump --username "gazelle" --format custom --blobs --verbose --file conformity-currentdate drupal-conformity
    $> pg_dump --username "gazelle" --format custom --blobs --verbose --file usecase-currentdate drupal-usecase-repository
    $> mv drupal-currentdate.tar.gz drupal-currentdate conformity-currentdate usecase-currentdate backups
  5. Turn the sites on maintenance mode: Login onto Drupal websites as administrator and go to Configuration --> Development --> Maintenance mode
  6. On portal, delete "sites" folder from the newly unpackaged drupal and copy sites, files and favicon.ico from the previous version of drupal to this new directory
    $> exit  # be user gazelle
    $> sudo rm -r drupal-7.x/sites
    $> sudo cp -r drupal/sites drupal-7.x
    $> sudo cp drupal/favicon.ico drupal-7.x
  7. Set the permissions, owners and groups for the new drupal
    $> sudo chgrp -R www-data drupal-7.x
    $> sudo chown -R www-data:www-data drupal-7.x/sites
    $> sudo chown -R drupal:drupal drupal-7.x/favicon.ico
  8. Remove the current symbolic link and create a new one to the latest release; also create link to the files folder
    $> sudo su drupal
    # check you are at /home/drupal
    $> rm drupal
    $> ln -s drupal-7.x drupal
    $> cd drupal-7.x
    $> ln -s /home/drupal/files files

     

  9. Go to https://gazelle.ihe.net/update.php and follow instructions to update the database
  10. Go to https://conformity.ihe.net/update.php and follow instructions to update the database
  11. Go to https://use-case-repository.ihe-europe.net/update.php and follow instructions to update the database
  12. Remove maintenance mode for all 3 sites
  13. Latest release of Drupal should now be running, check the version number from the Status report page.
  14. We recommand to also access the three sites with your browser in "private mode" because sometimes the maintenance mode does not go away. If it appears that the maintenance page is still displayed, accessing YOUR_SITE/admin/config/development/performance and clearing the cache might fix the issue. If not, untick the first two options of this page, clear cache again and check again the boxes.

Restoring an old version of drupal

If you need to come back to an old version of drupal, or if you unpackaged a backup to pick up somes files, run the following command

$> tar xvzf drupal-backupdate.tar.gz --preserve --same-owner