Upgrading from previous versions

Last modified: November 8, 2009 - 23:23

The following pages provide an overview of upgrading Drupal core and contributed modules. This section describes the steps to take to successfully perform major and minor Drupal upgrades.

Please note that the Drupal Project has frequent updates (see The Drop is Always Moving!).

Are you in the right place? Contributed module maintainers wanting to upgrade contributed modules should see Updating Modules. Themers looking to update contributed theme should see Converting a Theme to a Later Drupal Version.

Notes

  • It is best practice to back up your Drupal files and database(s) before upgrading.
  • Two major versions of Drupal are supported at a time. 6.x is the current version. 5.x is the prior version and is still supported. Drupal 4.x is unsupported.
  • Knowing what version to upgrade to:
    1. If upgrading from one minor release to another, such as 6.3 to 6.14, jump straight to the latest release within that major version.
    2. If upgrading from one major version to another, such as from 4.6 to 6.14, you must upgrade to the latest release within the major version (4.7), then the latest release within the next major version (5.20), etc. until you're at the latest release of the final major version
  • More upgrade information is available at:
    1. The UPGRADE.txt file packaged with your Drupal files.
    2. Release announcements for the version to which you're upgrading (e.g. http://drupal.org/drupal-6.2 for Drupal 6.2). Check the release pages of earlier versions if you must upgrade to them first (e.g., upgrading from 4.6 to 6.20--see above).
    3. Other pages of this handbook section.

References

Having Problems?
For problems during your site upgrade, instead of commenting here, please read the project page and, if necessary, post an issue there:

Update problem concerning missing term_node table ids
Currently (September 13th, 2009) there exist this updating problem if you have more than 39 taxonomy defined when updating from Drupal 5.19 to Drupal 6.13. At current all defined tid above 39 in the term_node table are deleted in the update process.

Use this how to to fix it manually:
http://drupal.org/node/569534#comment-2018056

Tarball Idiosyncrasy

The tarball was created from the parent directory of the directory containing the application. Doing 'tar -xvzf drupal-6.14.tar.gz' from your DRUPAL_ROOT directory, for example, will produce a directory inside that directory called drupal-6.14.

Sure, you can do the mv thing to fix, or you can just issue the following:

Gnu Tar version 1.17+

From the parent directory of your drupal install directory:

tar --transform='s,drupal-6.14,DRUPAL_ROOT,' -xvzf tarballfilename

Where: DRUPAL_ROOT is the directory name of where your drupal is installed and tarballfilename is the update you downloaded (drupal-6.14.tar.gz for example).

Gnu Tar version 1.16 and earlier

From your drupal install directory:

cd DRUPAL_ROOT
tar --strip-components=1 -xvzf tarballfilename

Where: DRUPAL_ROOT is the directory name of where your drupal is installed and tarballfilename is the update you downloaded (drupal-6.14.tar.gz for example).

Upgrading Drupal using a Patch File

QuangVan - May 2, 2009 - 18:15

Just wanted to note that you could upgrade Drupal using a Patch File.

Full Details Here: Upgrading Drupal with Patch File

You can also download the patch Files here:

Upgrade Drupal Easier

Haven't tried it myself, but having upgraded Drupal the traditional way, the Patch method seems easier.

Regards,
Quang

Upgrade Drupal in four easy steps with Drush--for minor upgrades

greg.1.anderson - May 15, 2009 - 17:06

First, put your site offline and make sure you have backups as described above. Then, from your Drupal root directory:

  1. drush dl
  2. mv sites/all/modules/drupal-VERSION /tmp
  3. rsync -rltD /tmp/drupal-VERSION/ .
  4. drush updatedb

Drush dl without any parameters will download the latest version of Drupal for you. Strangely enough, it puts it in the 'modules' directory, so we just move it out of the way. Next, we rsync the files from the new version of Drupal over the old, preserving permissions. (Don't forget the trailing slash at the end of the Drupal path.) After that, you're ready to do a "drush updatedb" and put your site back online.

Fast and easy!

Watch your robots.txt and .htaccess files!!

Berto - November 2, 2009 - 17:05

I need to add one important comment. If you copy a new version onto an old version, make sure that you do NOT overwrite your robots.txt and .htaccess files if you have custom ones.

This happened on one of my recent upgrades in Drupal 5.x and I bombed out both files, and my 301 redirects in .htaccess and disallow tags in robots.txt got lost for a month. Was definitely bad for business, so learn from my mistakes :)

Drop cache_block table if you use the Block Cache module

Gregory Go - July 26, 2009 - 04:58

Block Cache's functionality is part of Drupal 6 core, so you don't need the module anymore. But they use the same table name.

update.php will fail to create the cache_block table if it already exists. (see http://drupal.org/node/200221)

Unfortunately, there's no uninstall option for the Block Cache module, so you will need to manually drop the cache_block table.

Suggested fix if you've already upgraded before dropping the cache_block table is to use Devel module to manually run the create table query.

(This is for upgrading from Drupal 5.x to 6.x. Oops, I should have put it on 6.x tutorial page instead. If a kind admin would move it... thanks!)

 
 

Drupal is a registered trademark of Dries Buytaert.