Upgrading Drupal the easy way

I just upgraded this site to Drupal 5.2. The package came with upgrading instructions consisting of 11 steps to complete the upgrade proces, but after reading it a few times I realized it could be done easier.

Here is a synthesized version of the upgrade instructions that came with the package:

  1. Backup your database and Drupal directory. Especially your site settings, custom modules and themes, and files folder.
  2. Log on as the user with user ID 1. User ID 1 needs to be logged in so that you can access update.php (step 9) which can only be run by user ID 1. Do not close your browser until step 10 is complete.
  3. Place the site in "Off-line" mode, to mask any errors from site visitors.
  4. Disable contributed modules and switch to a core theme
  5. Remove all of the old files and directories from the Drupal installation directory.
  6. Unpack the new Drupal files and directories into the Drupal installation directory.
  7. Copy the backed up files/directories from step 1 to the Drupal installation directory.
  8. Verify the new configuration file to make sure it has the latest and correct information.
  9. Re-install contributed modules. Check if they are compatible with the new version
  10. Run update.php by visiting http://www.example.com/update.php
  11. Finally, return site to "Online" mode

Now, the thing is you don't have to do things like disabling contributed modules and themes if you install them right away instead of later on.

So, here are my simplified instructions:

  1. Unpack the drupal 5.2 folder on your local system
  2. Copy all your specific folders/files (files, themes, modules and settings.ini) to the right place in this folder
  3. Login as user 1
  4. Enable offline mode
  5. Delete all files of your Drupal installation on the webhost
  6. Upload the files from the drupal 5.2 folder to your webhost
  7. go to http://www.example.com/?q=user and login again
  8. Run http://www.example.com/update.php
  9. Enable online mode

These instructions worked fine for upgrading from 5.1 to 5.2. If you do are more drastic upgrade (e.g. from 4 to 5) you should only follow this method if you don't have any contributed themes/modules because otherwise you need to upgrade your modules.

Trackback URL for this post:

http://dieter.plaetinck.be/trackback/28
Submitted by Dieter_be on Sun, 07/29/2007 - 15:57. categories [ ]

Further improvements

I just noticed you can skip step 7 as you will remain logged in.

Also, you can save yourself some bandwith and some effort by skipping step 2, as long as you make sure you don't delete the sites and files directories in step 5. Don't overwrite them in step 6 either.

So now it's even more easy:

  1. Unpack the drupal 5.x folder on your local system
  2. Login as user 1
  3. Enable offline mode
  4. Delete all files and directories of your Drupal installation on the webhost *except* the directories files and sites
  5. Upload the files and directories from the drupal 5.2 folder to your webhost *except* the directories files and sites
  6. Run http://www.example.com/update.php
  7. Enable online mode

For what it's worth, I

For what it's worth, I managed to do it with even less steps (Drupal version 6.15):

1. Unpack the Drupal folder on your local system
2. Login as user 1
3. Delete all files and directories of your Drupal installation on the webhost *except* the directories files and sites
4. Upload the files and directories from the drupal folder to your webhost *except* the directories files and sites
5. Run http://www.example.com/update.php

* Remember kids, always backup your files & database beforehand!

Thanx for a very helpful page!

I very much like Drupal and its underlying philosophy. That's why I have encouraged several of my students to build their projects on Drupal, over other CMSs. Unfortunately, with each new version, it is quite painful to rediscover the path for an easy upgrade.

This brief summary should be the official upgrading doc. The one which is available now is quite difficult to follow. In fact, it would be very nice if Drupal had something similar to Moodle: copy the new version over the existing one (thus preserving any new files or modules you could have added), point to http://my.site/admin and presto, you have upgraded.

Thanks again,
Leonardo

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Security question, designed to stop automated spam bots