Friday, July 16, 2010

Upgrade Drupal

Drupal core could get updates due to security / bug fixes / patches and it is very important that your installation of Drupal be kept updated in this regard. Here are the steps needed to updgrade a Drupal installation:
  1. Backup current data
  2. Download & unzip update file
  3. Disable all contributed modules
  4. Revert theme to a core theme
  5. Delete all old files
  6. Upload new files
  7. Copy over the backed up folders
  8. Re-enable contributed modules
  9. Run update.php script
  10. Re-apply custom theme

Now lets discuss each of the above steps in a bit of detail:

1. Backup current data
Backup your installation database using phpMyAdmin or any other suitable tool.
Backup the files and sites folders

2. Download & unzip update file
Download files for the upgrade and extract the contents to a temporary folder. On Ubuntu, I just double-click on the file to do this. On WinX platforms, this cannot be done directly - you will need to download & install the free & open source tool 7-Zip to do this. Now you should have the full install files extracted into your chosen temporary folder.

3. Disable all contributed modules
Log in to the Drupal admin and go to Administer > Site building > Modules or the Drupal path admin/build/modules. Disable all the contributed modules.

4. Revert custom theme to a core theme
If you have a custom theme, revert it back to one of the core themes. Log in to the Drupal admin and go to Administer > Site building > Themes or the Drupal path admin/build/themes to do this.

5. Delete all old files
Delete all the files in your installation main directory - this ensures that there are no clashes between existing files and new files.

6. Upload new files
Now upload the files extracted in step 2 above folder to the main installation folder on the server.

7. Copy over the backed up folders
Copy back the files and sites folders backed up in step 1 above back to their respective folders.

8. Re-enable contributed modules
Log in to the Drupal admin and go to Administer > Site building > Modules or the Drupal path admin/build/modules. Enable all the contributed modules that you disabled in step 3 above.

9. Run update.php script
Drupal provides a special update script located in the root folder of the install for maintaining the database after upgrades. Log in to the admin section with your admin id(usually having id of 1 and is the first account to be creaed). Then point your browser to http:///update.php and click on the Update button. The modules requiring database updates will have their appropriate DB update number selected in their drop-downs. For most cases, the defaults should be fine. The database update may take some time depending on the number of updates to apply.

10. Re-apply custom theme
If you had a custom theme, re-apply it now. Log in to the Drupal admin and go to Administer > Site building > Themes or the Drupal path admin/build/themes to do this.

No comments:

LinkWithin

Related Posts Plugin for WordPress, Blogger...