Upgrading Drupal
From InstallationWiki
| Official Page |
| Project Documentation |
| Download |
|
Should it be necessary, it is important you know what to do in order to result in a painless upgrade. With Drupal, the process is fairly simple, but before we look at it, I should warn you: If you are using a theme other than the default, it is possible that your site may suffer some unusual effects. It may be best to revert to the default theme before performing an upgrade.
Contents |
[edit] Let's continue:
- Make a backup of your current database so that all the information added by users, as well as any configuration changes you have implemented, are saved.
- Back up the old files to somewhere else on your filesystem, especially those that have important changes and settings like your stylesheet, altered themes, or the configuration file contained in the sites/default/directory.
- If you are upgrading on a live site, log in as the site administrator (user number 1) and put the system into Maintenance mode in the Site maintenance section.
- Unpack all the new files – keeping any site specific files intact in the sites directory (otherwise, you lose all the information built up in the themes and modules directories).
- Navigate to the Drupal homepage and run the update.php script by accessing it from the browser. For example, the demo site's update page would be http://localhost/mf4good/update.php. This will bring up a page of notes as follows:
- Read through these notes before clicking the Continue button to ensure you perform all the tasks that may be required.
- Following on, a list of the possible updates that can be implemented will be displayed:
- Click Update – there should rarely be a reason for making changes to the updates selected. If everything goes well, you should see a list of updates that were performed, along with the status of those operations; something like this:
From this, you can see that there were a few alterations to the current database to bring it in line with the newer version. More importantly, no errors were reported so we can now take the site out of maintenance mode and continue on as normal. That is, until the next time…
[edit] Upgrading Modules
With time, modules also need to undergo upgrades and, as mentioned earlier, Drupal will inform you whenever a module is outdated or an upgrade is required for security purposes. These warnings will be displayed at the top of the page and look something like this:
Clicking on the available updates link that leads to Available updates page in the Reports section demonstrates that all is not well at the moment:
In this case, both DHTML Menu and Pathauto are outdated, so we will need to follow the standard procedure for safely upgrading each of these modules (it's fairly similar to backing up the site as a whole):
- Make a backup of your current database (sometimes a module may not need to make any changes to the database—but, better safe than sorry) so that all the information added by users as well as any configuration changes you have implemented are saved.
- Select the best upgrade option (in the DHTML Menu case this would be the 6.x-1.0 version—that is recommended). Remember to favor official releases over development releases because these will (hopefully) be more stable.
- Unpack all the new files into the modules directory under sites/default (or wherever you have saved the other contribs).
- Read through the INSTALL.txt and README.txt files that come with the module to see if there are any special notes or issues with the new contrib..
- Run the update.php script to execute any required updates to the system. If all goes well, you be presented with a far prettier Available updates page:
Remember that any errors that occur during the update process should be logged, and you can review them in the Reports section at the Recent log entries page. There is another valuable source of information you should look at, whenever you need to make an upgrade, namely the Drupal site itself: http://drupal.org/upgrade/. This page contains useful notes and version-specific issues and instructions that could come in handy.
[edit] Additional Refrences
If want to learn about building Drupal themes, click here
[edit] Source
The source of this content is Chapter 10: Managing Your Website of [1] by David Mercer (Packt Publishing, 2008.)
