Drupal 6 will be around for quite a while longer and module updates are still required periodically. Unlike Drupal 7, there isn't any automated update process for Drupal 6, so here's a complete step-by-step guide to the update process:
Step 1. Check for Updates
- Go to your Dashboard > Administrator > Reports > Available updates.
Step 2. Download the compressed module file
- Any updates needed will be shown in red.
- There will also be a link to the update so you an download it. If you want you can also search the drupal.org site for the newest versions of the module and download from there.
- Everything that is current will be in green with a check.
Step 3. Extract the files on your computer
- Download the zip or tar file.
- Extract the files.
- The unzip utility will automatically create a new directory with the name of the module and version. Inside that will be a subdirectory that has a shorter name for the module.
In the illustration above:
- backup_migrate-6.x-2.5.zip is the original archive.
- backup_migrate-6.x-2.5. is the folder with the created by the extraction process.
- backup_migrate is the folder you will be uploading to the server to replace the old one.
Step 5. Backup the database
- If you have a recent backup of the data base you are OK. If not, backup the data base now.
- There isn't a huge risk that you'll corrupt the data, but might as well make a backup for safety. If you're doing several modules in one session, you won't need to do a backup before each upgrade. One will be sufficient..
- Here is a tutorial on backing up a Drupal database; Drupal's Backup and Migrate Module
Step 6. Log in as Administrator (User 1):
- Log in as Administrator (User 1). User 1 is the very first user created when you install Drupal. User 1 has special privileges, even though you may have other administrators, User 1 is special, if you are not logged in as User 1 you will have problems. Here's a brief explanation: Who is Drupal User 1?
Step 7. Login to the site via FTP or a file manager
- On the server go to your /sites/all/modules folder.
- On your local computer find the module directory you created when you uncompressed the downloaded file.
- In this illustration, I am using the Backup and Migrate module, so mine is named backup_migrate. Yours will be named for the module you are upgrading. You may be uploading more than one at a time. Just to make it convenient we have the file manager open and ready. We'll be coming back to this shortly.
Step 8. Set site status to 'Off-line':
- Go to Administer > Site configuration -> Site maintenance)
- The reason for entering maintenance mode is that you don't want web visitors to call up module code while that same module code is missing, incomplete, or being deleted or written. That would lead to ugly temporary errors or, in the very worst case, to database corruption. An alternative would be to disable the module temporarily, but you need maintenance mode for the later running of update.php anyway.
- Choose Off-line.
- Write a new offline message if you need to.
- Save configuration.
- If anyone logs in during your upgrade, they will get the offline message. This is so you won't have any changes happen during the actual upgrade, which may corrupt the data base.
Step 10. Delete the old module
- Warning: Do not uninstall the module, That may delete all the data data the module may have kept in the database.
- Instead, using FTP or the file manager, delete the module's folder. It will be in sites/all/modules.
- Upload the new module from your computer to the server to replace the old one.
Some precautions you will want to take: Backup the old module's folder or move or copy it to another directory. If something goes wrong, you will have the original folder intact for an easy restore. If you have made some customizations to the module, you may need to copy them from the original to the new. So keeping the original until you are all done is a good idea.
Step 11. Run update.php
- Do not log out.
- Open another browser window.
- Type http://yoursite.com/update.php in the browser address bar.
- Make sure again that you are logged on as admin User 1, then run update.php. If are logged in as any other admin update.php won't run.
- Click Continue and go through the steps of the update procedure.
- The most important point here is to check the displayed log for any errors. If there are errors, you have to find out what went wrong, before you put the site back online.
- If no errors, set site status to 'Online':
- You should still have your admin user open in another browser window. Return there and choose to put the site back online.
Your module has now been successfully updated.