Open source software security

Drupal 5 to 6 Upgrade

30 November -0001

Drupal supports two versions at any given time (a major and a minor). Currently these are Drupal 6 and 5 respectively. This scheme ensures that Drupal is always fresh, but with new versions constantly in the works (Drupal 7 is floating around now) it also means that at some point you'll have to upgrade your Drupal site in order to keep it in support. Upgrading is always a scary process, and I recently upgraded a site from Drupal 5 to Drupal 6. Unfortunately the process didn't go as smoothly as this screencast makes it seem, but it wasn't a total disaster. The biggest hurdles for me were fixing friendly URLs. They weren't working after the upgrade, but figuring out the "unfriendly" versions of link targets to use so I could get them working was a chore. I needed the friendly URL settings to be correct before the upgrade.php script would even work properly. After that I needed to rebuild permissions. Also, my image galleries got really borked up. Some of the entries for images mysteriously disappeared from the database. In the end I had to use the following SQL to get the linking between the file, image, and node table back:

INSERT INTO image (nid, fid, image_size) SELECT u.nid,u.fid,f.filename FROM upload u, files f WHERE u.fid=f.fid AND f.filename='_original' AND u.nid NOT IN (SELECT nid FROM image WHERE image_size='_original');

But the upgrade completed. I'm not looking forward to doing it again, but all in all it took me less than 5 hours of work.