Thursday, April 24, 2008

Upgrading Drupal

In light of the up and coming (at the time) Pennsylvania Democratic primaries, I was asked by my alma mater's student Democrat organization to create a website for their group. I thought this would be a great opportunity to give an open source CMS (content management system) a try. I ended up choosing Drupal and was able to get it up and running with relative ease. To my surprise (and frustration), only a week later, the Drupal developers released a new version, compelling me to upgrade. In this post, I'm going to talk a bit about the Drupal upgrade process and upgrade processes in general.

Upgrading Drupal, or any application for that matter, is often much harder than performing an installation from scratch. Two major hurtles come to mind.

(1) Compatibility. Will all your stuff still work with the new version?

When Microsoft releases a new version of their Office suite, for example, you want to know that *all* your Word documents created by previous versions can still be opened.

Drupal, unfortunately, doesn't make things that convenient. In the cosmic balance between the software pragmatists and the software idealists, the Drupal team, unlike Microsoft, fights for the idealists. Any time they release a new "major" version (that is, 5.x to 6.0, for example), they pretty much guarantee that all existing custom themes or modules will *not* work. This is because they are very much willing to throw away a large part of the codebase if they think there's a better way of doing something.

These compatibility issues, however, are not an issue with "minor" upgrades (such moving from 5.4 to 5.5). This is because minor upgrades usually deal with security fixes and implementation details that your custom modules and themes don't care much about. Luckily, the upgrade I wanted to perform, 6.1 to 6.2, was a minor upgrade, so I knew with a high degree of confidence that all my custom themes and modules would still work (and they do).

(2) Data preservation. Will any of your data be lost in the upgrade process?

Of course, you want this answer to be a resounding "NO WAY!". For example, if you upgrade to a new version of Firefox, you don't want to load up your new version, only to find that all your bookmarks are gone.

In Drupal's case, this means not loosing your custom themes, custom modules, site content, and files your users uploaded. What makes this a bit complicated when upgrading Drupal is that the Drupal team recommends you completely remove all files from your existing Drupal installation and then do a fresh copy of all the files from the new version (as opposed to just overwriting everything). This means that you must be aware of all the ways in which your Drupal installation differs from the "base" or "initial" installation. That is, you must know about your custom themes, custom modules, etc. so you can put them back after you've copied over the new version.

I find it helpful to maintain a list of all of these differences. That way, whenever I have to upgrade, I know exactly what files to put back into the new version to keep my site running smoothly.

Now that you've got an overview of what to expect from your Drupal upgrade, you might want to do some reading on the Drupal website for more of the technical details. Good luck!

No comments: