Notes on Upgrading to Drupal 6

I recently upgraded this site to Drupal 6 and wanted to share a few notes. I had several objectives during this upgrade:

  1. Upgrade to Drupal core and contributed modules to version 6
  2. Convert audio and video content types to cck filefield with swftools (and Quicktime media to Flash)
  3. Convert to Drupal's multi-site architecture to allow my self to be able to run additional sites in the future
  4. Get the site under version control with Subversion and deploy with Sitecopy.
  5. Use my new theme

1. Upgrading to Drupal 6 works a lot like doing any core or module update - you copy the new version's files over the existing files and run update.php. When doing a full core version update though, I like to do something a little more cautious - I do the upgrade locally on my computer first and once I work out all the issues on a local copy of the site, and then upload the new version site and database.

So I was able to follow all the normal steps: update Drupal 5 and all the modules to latest Drupal 5 versions first, copy Dupal 6 core files over Drupal 5 files, disable all no-core modules, and then run update.php

Next I copied over the Drupal 6 version of CCK and all the other contributed modules I am using and ran update.php for them. At this point everythng was converted but I still needed to convert audio and video node to cck nodes using filefield.

This post at GeeksandGod.com explains exactly how do write a short php script to do this. This was great because I didn't have to figure this out myself. I made cck filefiled based content types for my audio and video posts and then ran a script similar to the one above to convert them. Some of the files didn't come over cleanly so I had to reset them manually - but it went fairly fast. Additionally I converted all the Quicktime video to Flash and had to re-upload those media files - but there were only six or seven to do.

I also converted to multi-site to allow myself to run more than one site on this Drupal installation. I had not tried a multisite installation and was shocked at how simple it is. If you develop more than one Drupal site and are not using multi-site - you are working too hard. My setup on my local machine is as follows:

  • a normal Drupal 6 install with all Drupal core in the Apache root folder and the contributed modules in the sites/all/modules folder.
  • In the sites folder, a folder called geoffhankerson.com with the settings.php file and a themes folder holding my theme. Now this alone does not work on my local machine because my local Apache and Drupal install are not on the server that hosts geoffhankerson.com. To make this work locally, I just make a symbolic link from geoffhankerson.com to geoffhankerson.local (ln -s geoffhankerson.com geoffhankerson.local for Linux and Mac on the command line - not sure how to make that work in Windows). Then I create and entry in my /etc/hosts file to point geoffhankerson.local to 127.0.0.1 or localhost.

3. I had lazily not put this site under version control because I had never bothered learn Subversion. I'm still no svn guru but I have it running. Searching Google for Subversion tutorials and screencasts really helped. Many of you might not be as familiar with Sitecopy. It's a Unix application that automatically copies your local files to a remote server. You have to compile it but that's as easy as configure, make, make install. Then you just make a configuration file that looks like this:

site sitename
server ftp.servername.com
remote /
local /path/to/local/copy
username ******
password ******
exclude settings.php

Sitecopy will keep an index of files on your computer and compare them to what's on the server. Then

sitecopy --update sitename

will upload new file whenever there is a new version locally - make security updates much easier.

Some of you might ask, why not just run Subversion on the Web server and put your repository online. Well - I would but I can't run Subversion on this server (shared hosting). So Sitecopy is a good surrogate in this case.

Last, I just put my new theme my themes folder and I have my new Drupal 6 site with a new theme ready to deploy with Subversion and Sitecopy. I hope to contribute my new theme to Drupal.org soon

In my next posts, I hoping to get back to my series on converting Photoshop mockups to Drupal 6 themes.

Thanks for the post

Thanks for the post Geoff,

Neuro Performance & Health℠

Added to DrupalSightings.com