Building a Programmers Blog: Module Installation

This post is less of a tutorial and more of a reference that you'll find useful as you read future posts.

Expansion of Drupal - adding new features and capabilities - is primarily done by adding new modules. Installing a Drupal module is a relatively simple procedure, but there are a few issues of which you should be aware.

As a part of the Drupal installation, you'll find a \modules\ subfolder. Counter intuitively, this isn't where you should install additional modules. In a fresh Drupal installation, the only modules included here are those "in core" - the modules that form the core installation. Installing additional modules into this directory will make it harder to install new releases (including security updates) of Drupal.

Instead, look for the \sites\ subfolder of the installation - custom modules should be installed into \sites\all\modules\. You may need to create this folder if it doesn't exist.

Once a module has been copied into place, log on as a user with Administration rights. Go to Site Building, Modules and turn on the new module. Don't forget to apply your changes with the Save Changes button at the bottom.

Upgrades

Upgrading a module is similar to original installation, complicated by the module already being in use.

If your website is active while you're upgrading a module, you run the risk of the code running while you're in the midst of the upgrade. While it's unlikely that a hybrid (half upgraded) module would cause any permanent issues, it's likely that it won't run properly, perhaps giving one of your readers a nasty error or a blank page. To avoid any possible issues, be sure to take your site offline while you do the upgrade.

Also, module upgrades sometimes (often) require database changes. To give any newly installed modules a chance to apply needed upgrades, you should always visit /upgrade.php after any change.

Here's a suggested process:

  • Ensure you're logged on as a user with Administration rights. Go to Site Configuration, select Site Maintenance and take your site offline.
  • Upload your new modules.
  • Visit mysite/upgrade.php page to allow the new module versions to update your system.
  • Return to Site Configuration, select Site Maintenance and bring your site online again.