Updating a Module
with Joe Shindelar This tutorial covers how to
update a contributed module by using the
administrative interface and running the
database update script. By the end of this tutorial, you'll know how to
update a contributed module and run the
database update scripts. Before doing this,
you should make sure that you have a
contributed module that's been installed and there's an
update available for it; you have a development
version of your site that you can
test this on first; that you've created
a full site backup before proceeding
on the live site; finally, the Core
Update Manager module must be installed in order to
run the database update script in the browser. Note that if
you're using Composer to manage
your site's dependencies, you'll want to follow the
tutorial on using Composer to update the code, and then come back here for instructions on running
the database update script. Before you start,
you'll want to check for any module-specific
update instructions. This is typically necessary
while updating modules that involve the usage
of third-party libraries, but it's also
always a good idea to read and understand all
module-specific requirements before proceeding
with an update. To find the instructions, check the
module's project page. So for the
Google Analytics module, I can check the project page. I might read
the existing documentation. One good place to look is by
clicking on the release, which you're
going to update to, which will take you to
the project's release notes. Here, you can browse
through the release notes and see if there are
any special instructions about updating. Finally, you can also
download the files that you're going to be
using during the update and look for an update.txt, a readme.txt or an
install.txt file in that code that might contain
additional instructions. If you're not using Composer to manage your
site's dependencies, then the modules
can be updated using the
administrative interface. If you're updating
a custom module rather than
a contributed module, or if you see a message saying,
"Installing modules and themes requires FTP
access to your server," or if the following steps
do not work for some reason to obtain the
new module files, follow the steps in the
Manual Installation tutorial, then continue here
with the step for running
database updates. To use the
administrative interface to update a
contributed module, first, put your site
into maintenance mode. Click on Configuration,
then under Development, click on Maintenance mode and check the box Put your
site into maintenance mode and click
Save configuration. Once your site
is in maintenance mode, in the
Manage Administrative menu, navigate to Reports
and then Available updates and then Update. This page shows you a
list of all the modules that need updates. Find and check the box for each module you
want to update in the list, then click
Download these updates. On the next screen,
click Continue. Once that's complete, you'll need to run the
database update script. If you obtain the
new module files manually or use Composer to download, start with this step and reach
the database updates page by typing in
"/update.php" in your browser. Click on
Run database updates. From the Updates page,
click Continue. If there are any
updates to be run, you'll have the
opportunity to review them and then
execute them at this time. If there aren't any, you'll be taken
to the final step, which is this page. From here, you can return to the administrative
section of your site by clicking on
Administration pages. After that's complete, you can put your site
back into online mode, or take it
out of maintenance mode by un-checking Put site
into maintenance mode and clicking
Save configuration. Finally, it's a good idea
to clear the cache after performing updates,
just for good measure. In this tutorial, we learned how to
update a contributed module using the user interface provided by the Core
Update Manager module and how to run the
database update script.