A Note On Updating

These days, now the Update Status module is core in Drupal 6, people find themselves updating their core, modules and themes far more regularly than before. This is, of course, a very good thing. I'd just like to raise a couple of points of order on the matter:

When updating it is always tempting to copy the contents of the downloaded tar file straight over the existing module or theme. Don't! It is entirely possible there are files with the old version which are not required by the new one. Worse, they may even do some harm.

Take a back-up copy of your old module or theme (and database), delete it entirely from the Drupal application, then copy in your new module or theme where the old one was. Now you absolutely know you have the latest version and *only* the latest version, with no orphan files or sub-modules floating around.

All that remains to be done is login as user 1 and run update.php. Anything goes catastrophically wrong? Restore your old database and module/theme directory.

One other note - it is unwise to ignore the warnings to update for too long. The longer you leave it, the further from HEAD your version of the code gets and the more painful the upgrade path is likely to be. You have been warned! =)

2 comments

by Chris on Wed, 09/06/2010 - 15:30

When you use drush and the pm-update function.. is the folder deleted and recreated by the command ?

by greg.harvey on Wed, 09/06/2010 - 15:57

It is with Drush 3, not sure about previous versions. It moves the folder to a back-up location and echoes that to you in the terminal, in case you need to roll back. =)

Post new comment

© 2010 Greg Harvey. Drupal theme by Kiwi Themes.