Updating Drupal 7 Modules

Drupal Version

Before You Begin

  • Installatron does not upgrade modules, so even if you use Installatron to manage your Drupal core upgrades, module updates must still be done manually.

  • If you are managing a Drupal 8 or later site via Composer, you do not want to use the following instructions, as all updates will be handled through composer.

  • The instructions below assume your site is on a UNIX style web server and regularly reference the OIT Web Hosting environment.  If your site is hosted on a different kind of web server, then these instructions may have to be modified to work correctly for you.

  • Additional information can be found on the Drupal.org page about module updates.

Drupal Module Update Process

  1. Open up a web browser and navigate to your Drupal site.
  2. Login to the site as an Administrator.
  3. Put the site into maintenance mode (Configuration -> Development -> Maintenance) by enabling the "Put site into maintenance mode" checkbox and saving the configuration.
  4. Either via SSH/SFTP or (for sites on OIT Web Hosting) the Plesk Control Panel, make a backup of your site's filesystem.
    • If you are using SSH, you can navigate to your site's base directory and issue the following command:
      • tar czf ~/drupalbackup.tgz *
    • If you are on OIT Web Hosting, you should store your backup in the "private" folder like so:
      • tar czf ~/private/drupalbackup.tgz *
  5. Backup your MySQL database.  On OIT Web Hosting, the easiest way to do this is to log into the Plesk Control Panel for you site and access phpMyAdmin via the Webadmin link in the Databases management section.  On the other hand, if you are on a stand-alone web server where you have direct access to mySQL commands, you can run a command like the following (be sure to insert the correct username, password, and database name for your particular website):
    • mysqldump -u USERNAME -p DATABASENAME > ~/backups/database-backup.sql
  6. Either via SSH/SFTP or (for sites on OIT Web Hosting) the Plesk Control Panel File Manager, locate the existing installation of the module and either delete it or move it somewhere outside your Drupal installation's base directory.
  7. Download the archive file for the new version of the module and unpack it into the same location where the module had previously been installed
  8. Via SSH, a typical set of commands for steps #6 and #7 might look like this:
    • cd /path-to-your-drupal-site/sites/all/modules
    • rm -r modulename
    • wget https://drupal.org/files/projects/module-x.y.tar.gz
    • tar -xzvf module-x.y.tar.gz
  9. Return to your web browser and navigate to  https://yourSiteHostName/update.php.  Follow the prompts to apply any database table updates that are needed.
  10. Check the administrative Status report to verify that everything is working as expected.
  11. Navigate to the Maintenance subsection of the Development section of your site's Configuration administration area (Configuration -> Development -> Maintenance) and disable the "Put site into maintenance mode" checkbox.  (Don't forget to save your change!)