Look, Drupal 7!

Photo of Greg Harvey
Thu, 2011-01-13 15:11By greg

This is now my first Drupal 6 to Drupal 7 upgrade. Not without hitches, but all in all not too painful. Hope you like the new look. As dedicated readers may know, I never stick with the same theme between major Drupal releases, more often than not because my previous theme was never ported and I can't be bothered to port it myself. The new theme is the rather pretty Corolla, which you can find here:

Here are some Drupal 7 upgrade notes and links others may find useful.

Firstly, the modules that are not ready/will never actually be ported:

Content Access (but there is a patch: http://drupal.org/node/690610)
Node Images

So all of those I had to opt to live without for now (with the exception of Content Access, I applied the patch but I haven't had chance to verify it works yet because ACL has a critical bug - see below).

CacheRouter is a bit of a pain, as it was one of the easier ways to get some advanced caching going without needing to install anything in your operating system. You can read the full story here:

I was using the 'filecache' engine which, as far as I can tell, has not yet been ported to use Drupal's new caching API, so your only option for simple caching right now is Boost. Which is still broken:

The simplest currently available caching mechanism is probably the new Drupal 7 APC module, which is by slantview who made CacheRouter in the first instance:

Install APC for PHP and install that module (don't forget to open README.txt and follow the steps) and you'll have some caching that isn't using the database and *should* be a significant performance gain on a weedy VM (like this one). It's not quite as straightforward as 'filecache' or Boost (which you just enable and tweak some settings and it's done) - you have to install other stuff - but it's pretty easy.

Next, some useful resources:


The former is all the upgrade steps you should need. The latter is cutting to the chase, the actual upgrade steps - it's linked to from the first one anyway.

So, following the steps I backed up everything, downloaded core and ran update.php over my old database. First thing you might see is this:

date_default_timezone_set() Timezone ID '3600' is invalid

Don't worry about it - it's harmless: http://drupal.org/node/1020748

So, that went ok. Next put the available Drupal 7 contrib modules and themes back in to sites/all (or wherever they were) and run update.php again to run their upgrade code.

If you use the Global Redirect module, you will have a problem at time of writing. Take a look at this:

Not a biggy, but you'll have to patch/alter your install file for the upgrade to work. This will change with the next release, it seems.

And Rules currently has no upgrade path at all, so forget about that one for now. It's coming. Fago tells me [new window] clean installation should work though. Again, watch this space - an upgrade path is coming.

Another one that got me is a bug in the current Drupal 7 version of ACL. It's a show stopper right now, so use the dev snapshot, not the release, if you want to play with ACL - beta3 onwards should be safe(r):

Finally, once you're all set up you might see one or all of these little gotchas:

Expect to have to rebuild some Views (especially around Comments and user Profile fields). Many handlers are changed between Views 6.x-2 and Views 7.x-3, and are not automatically upgraded. This also results in some pretty horrible failures at first and freaks you out until you realise it's just missing Views handlers (*phew*).

No easy way around this. You have to go to Views UI and click your way through all the broken handlers, deleting the obsolete Drupal 6 handlers and creating new fields, sorts, relationships, etc. etc. with the new Drupal 7 handlers. This is a real pain. I'm hoping there'll be a Views updater at some point for your Views 2 views to clean up all the handlers. For now the upgrade path catches and repairs some instances, but nowhere near all.

Edit: Just found another issue after saving this node! All the tokens have changed and are not automatically upgraded it seems, so you'll need to go and edit your pathauto settings (and possibly other places where tokens are used) to make sure the correct values are being used.

Far less painful, you might see Filter module notices (I got one because of a filter provided by the Messaging module) - just re-save the Filter concerned (or delete it if it's not needed any more):

Finally, the new Fields replacement for CCK has some minor issues being resolved. You may (probably will, it seems) see notices like this:

Notice: Undefined index: required in field_default_form()
Notice: Undefined index: description in field_multiple_value_form()
Notice: Undefined index: description in field_multiple_value_form()

For now all you need to do is save the Manage Fields page of the content type and this goes away. Seems a coded fix is in the pipe:

One final observation. I seem to be experiencing overly aggressive menu caching with Drupal 7. After module removal links persist in admin, other menus are slow to update, seems there might be a small bug. And before anyone points at APC, it uses the caching API anyway and besides, I hadn't actually enabled it yet. One to watch...

That's all for now. Upgrade to Drupal 7! It's fun! (Kinda...)