Welcome to my corner of the web. Here you'll find my ramblings about faith, church, drupal, Geeks and God (my podcast), and my other unrelated interests.

While you can subscribe to all posts here from the Subscribe link on the right, there are two other main feeds. There is the drupal and other technology feed along with the faith and church feed.

How To Upgrade Drupal

Posted on: Fri, 2007-01-05 11:02 | By: matt | In:

DrupalDrupal is nearing time for its next release and along with this next release is coming a more detailed set of upgrade instructions to help admins upgrade with more ease. These improvements were based on a bit of user feedback which created a set of instructions even a novice can use.

While these instructions, in the UPGRADE.txt file, cover most aspects there is even more detail over at http://drupal.org/upgrade. Lets walk through these instructions.

UPGRADING
---------

1. Backup your database and Drupal directory - especially your
"sites" directory which contains your configuration file and
added modules and themes, any contributed modules in your
"modules" directory, and your "files" directory which contains
uploaded files.

Note: for a single site setup the configuration file is the
"settings.php" file located at sites/default/settings.php.
For multisite configuration the configuration file is located
in a structure like the following:

sites/default/settings.php
sites/example.com/settings.php
sites/sub.example.com/settings.php
sites/sub.example.com.path/settings.php

More information on multisite configuration is located in
the INSTALL.txt file.

This is one of the most important steps. Make a backup. Accidents happen, things break, and no one wants to be left out in the cold when things go wrong.

2. Disable contributed modules and switch to a core theme
(Bluemarine or Garland).

This is important and often overlooked (by me anyway). If you don't have the same theme or module with the same theme name or module name on the other side of the upgrade compatible with the new version there may be problems.

3. Log on as the user with user ID 1. User ID 1 is the first
account created and the main administrator account. User
ID 1 needs to be logged in so that you can access update.php
(step 8) which can only be run by user ID 1. Do not close
your browser until step 9 is complete.

4. Remove all of the old files and directories from the Drupal
installation directory.

The idea here is to not just overwrite the old files with the new ones but completely remove the old ones. Problems can creep in when you just overwrite like the in the move from 4.7 to 5.0. Some files will stick around from the old version that can cause problems.

5. Unpack the new Drupal files and directories into the Drupal
installation directory.

6. Copy the backed up "files" and "sites" directories to the
Drupal installation directory. If the original .htaccess or
robots.txt files have been modified, copy the backed up
versions of these files to the installation directory as
well.

7. Verify the new configuration file to make sure it has the
latest and correct information.

From version to version there may be minor changes to this file. In the upgrade from 4.7 to 5.0 there aren't any changes.

8. Re-install contributed modules.

Note: make sure the version of a module matches your
version of Drupal. Modules from previous versions may
not be compatible with the current version. Check
http://drupal.org/project/Modules for the version of a
module to match your version of Drupal.

This is where contributed modules should be added back in. The place to put these modules in 5.0 is the /sites/all/modules folder or for just a single domain on a multi-domain setup the /sites/yourdomainname.com/modules folder. The same goes for themes with just a change in the path from modules to themes.

9. Run update.php by visiting http://www.example.com/update.php
(replace www.example.com with your drupal installation's
domain name and path). This step will update the database to
the new Drupal installation.

Note: if you are unable to access update.php do the
following:

- Open update.php with a text editor.

- There is a line near top of update.php that says
$access_check = TRUE;. Change it to $access_check = FALSE;.

- As soon as the script is done, you must change the update.php
script back to its original form to $access_check = TRUE;.

For more information on upgrading visit the Drupal handbook at
http://drupal.org/upgrade

Hope this helps others upgrade as it has with me. Know any other tips, tricks, or insights into upgrading? I'd love to hear them if you do.

Comments

#1 CCK

My big question on upgrading from 4.7 to 5.0 is this: What happens to my CCK content types?

Since CCK is now part of core (and, in effect, is no longer "CCK"), does the new 'core' functionality recognize your old CCK types? Will it just roll them into the new functionality?

For example (in case this isn't clear):
Let's say I have a content type called "Motorcycle Club" that was built in 4.7. It's used to list all the motorcycle clubs in the area...each club is a node. Each CCK type consists of the following fields: Club Name, Club Address, Club Contact, Google Map Link, Contact phone number, club zip code, and contact email address.

So, this type consists of regular text fields, email fields (with the email module), zip code filed (with the zip code module), etc.

When I upgrade to 5.0, will all this still be recognized perfectly?...will it just be wrapped into the "home-administer-content management-content types" area of the admin? Will the email and zip code modules still be needed?

Let me know what you know about CCK rolling into 5.0. (my assumption is that it'll work seamlessly, and this was a big-ass-question for no reason).

#2 CCK not part of core

The CCK module is not part of core in version 5.0. The CCK module and the other modules that support CCK are still contributed modules. You can get to it at http://drupal.org/project/cck. The version, as of this comment, for 5.0 is still in beta testing.

If you had cck in 4.7 and you upgrade to 5.0 run the update.php script and it will update the database to work with the newer version of cck.

What is in core is like a light weight cck. You can create, with a name of your choice, simple nodes types with the same fields as the 4.7 page and story modules. This does not tie in with with the cck module.

Does that make sense?

#3 4.7.x to 5.0 upgrade video

The folks over at lullabot put together a video walking though upgrading. It's worth checking out. You can get to it here.