Upgrading Drupal 5 to Drupal 6 in Detail

September 18
blog author



I worked on a project that required me to upgrade an existing Drupal 5 website to Drupal 6. After researching on how to tackle this project, I found a great tutorial on drupal.org, http://drupal.org/videocasts/upgrading-to-6. Just like any software development, I broke this problem into managable pieces and started tackling them one by one. Before starting the upgrade, I setup a repository of this Drupal 5 instance and created a database snapshot. After each step of the process, I created a snapshot of the database and "commited" any file changes to the repository. From this, I was able to keep track of my progress, and I was able to revert to the previous state of the site in case something was to happen. Here are the following steps to update a Drupal 5 website to Drupal 6:

1.Update your site to the latest Drupal 5 release and run update scripts, if any.

2.Go through all your contributed modules and check to see if they need to be updated to the latest Drupal 5 release before upgrading to the Drupal 6 version.

NOTE: If you are using CCK, it is advisable to update it to the latest Drupal 5 release. If you are using Workflow module, export your "rules" and save it as a file so that you can import back.

3.Disable all your contributed modules

4.Replace all Drupal 5 files with Drupal 6 files, except the “sites” folder.

5.Change your theme to Garland or other theme you prefer.

NOTE: You can omit this step, but I find the site less intimidating and scary if it is somewhat themed during the upgrading process.

6.Navigate to update.php and run all core update scripts.

NOTE: Step six does the necessary database changes, such as adding/removing core table fields. Once this step is done, your Drupal 5 core module tables will resemble the Drupal 6 tables.

7.Replace all Drupal 5 contributed modules with its corresponding Drupal 6 version.

8.Navigate again to update.php and run all update scripts. This will convert all Drupal 5 contributed module tables to its Drupal 6 version. NOTE: There are some modules such as FAQ that has renamed one of its permissions from “view faq” to “view faq page” so you might want to set the permissions manually or perhaps you can write an update script that.

9.If you have custom modules, convert the modules that interact with the Drupal core, or modules which extends functionalities of your contributed modules, by replacing Drupal 5 hooks to its Drupal 6 version (hook_form_alter). You should also watch out for functions that have changed (taxonomy_node_save).

10.Convert your theme to its Drupal 6 version. NOTE: The way you declare regions in Drupal 5 is different from Drupal 6.(see http://drupal.org/node/132442 for more information on theming changes)