How to Upgrade from Drupal 5 to Drupal 6 - Step 2: Getting Drupal 5 Upgrade Ready

Last week I started a series of posts about upgrading to Drupal 6. Starting with Finally Time to Upgrade to Drupal 6 followed by How to upgrade Drupal 5 to Drupal 6 - Step 1: Planning.

If you are planning an upgrade to Drupal 6, you might want to read those posts before reading this one. In the last post I suggested making an upgrade plan and doing some legwork before you jumped into the act of upgrading. Part of that plan is to prepare your Drupal 5 site for upgrade. In other words, do everything you have to do to your Drupal 5 site ready before you finally start moving it to Drupal 6. Depending on your site and how up to date you like to keep it, this may be at least as time consuming as the actual move from Drupal 5 to Drupal 6.

Always Backup First

As with any upgrade process one of the first things you are going to want to do is back up everything. This includes all the files in your installation directory as well as your database. If you are using some kind of version control system for your site (like Subversion or CVS), you are probably not maintaining version control of the one or more Drupal 'files' directories. Don't forget to back up those directories as well.

If you've never recovered a site from a backup, it may be a good idea to practice how to recover from your backup before proceeding. If nothing else, its good practice. But, in a worst case scenario if you actually do need to recover from a backup because something went wrong, that practice will save you precious time while your site is sitting off-line.

Update Drupal 5 to the Latest Stable Version

I just wanted to note that if you do not have a testing/development/staging environment (e.g. localhost) I would encourage you to install a copy of your site on your server or on your localhost and attempt the following steps on the copy before actually updating your live site.

The next step is to get Drupal 5 up to the latest stable release version. Drupal constantly issues bug fix and security releases after an initial release. At the time of writing the latest stable release for Drupal 5 is 5.14. Its always good practice to keep your Drupal site up to date with the latest releases (for security and stability), but its particularly important when upgrading to a newer version. Some of the 'point' releases may have included database schema changes that are expected to be in place by the new version of Drupal. If they aren't in place there is a chance of an error occurring during the upgrade. Anything you can do to limit the likelihood of an error occurring during an upgrade should be done before the upgrade.

Be sure to read the release announcements for the latest 5.x release for any special upgrade notes.

Update Contributed Modules to the Latest Stable Release Versions for Drupal 5

In the planning phase I encouraged you to make an inventory of all your modules and to investigate whether or not there were compatible versions for Drupal 6. I also encouraged you to research what the upgrade path is for each contributed module on your site.

In many cases the upgrade path for individual modules will require you to have the latest stable release of each module installed in Drupal 5 prior to upgrading your site to Drupal 6. Every module is different, so pay close attention to the update instructions for each module. Update each module individually. You also want to pay attention to possible module dependency changes you discovered during the planning stage as this will impact on the order in which you update each module.

It is also a good idea to test your site after you update each individual module to ensure that it is still functioning normally. The last thing you want to do is try and upgrade your site to Drupal 6 from a 'broken' state caused by a bad module update.

It may also be a good idea to backup your database after each module update. Doing so may save you the effort having to repeat several module updates again if one of them should fail during this process. You would be able to restore to a point after other modules were updated, but before the last one caused a problem. If you are an advanced user and intimately understand what code is executed during each module's update, use your best judgment on how frequently to backup during this process.

Remember, when I'm talking about updating individual module, at this point I am only talking about updating them to the latest 5.x versions. Do not attempt to install Drupal 6.x modules on your Drupal 5.x site.

Other Action Steps to Prepare for Drupal 6 Upgrade

After you have brought Drupal 5 to the latest stable release and updated the contributed modules as required, there are a few more steps you can take at this point.

Check Update Status

Even if you are following a planning document that you created for yourself, you may have missed a module when updating. You can always check to make sure you are up to date by visiting the update status page (provided by the update status module) on your site.

Document Your Experience on Your Planning Document

If you hadn't done so during the steps above, why not jot some notes down on your upgrade planning document detailing how the process went and what gotchas (if any) you encountered. Having those notes will save you time if you have to upgrade more than one site.

Download

It almost goes without saying, but you need to download everything you will need during the actual upgrade to Drupal 6. This includes Drupal 6 itself and all the contributed modules and themes you identified during the planning phase.

Custom Modules and Custom Themes

If you have written your own custom modules that you are using on your site, you will need to re-write/convert them to Drupal 6. Detailed documentation for module conversion can be found at http://drupal.org/node/114774. The Drupal Module Developer's guide is also a valuable resource http://drupal.org/node/508.

Any custom themes you have created will also need to be converted. Once again detailed documentation can be fount at http://drupal.org/node/132442 to help you.

Next steps

In my next post, I will wrap up this series by going through my thoughts and suggestions for the actual Drupal 6 upgrade. As always, post a comment if you have any additional insights or links that may be valuable to others.

Update The final article in this series Step 3 and 4: The actual upgrade and testing is now on-line

January 12th 2009 2AM
By: andre