Upgrading a Drupal Installation

OK, I attempted a Drupal upgrade as soon as I made a test area for my Drupal CMS installation, and managed to get it wrong from the start.

So, to recap, here are the upgrade instructions from Drupal (after backing up):

  1. Log on as the user with user ID 1
  2. Place the site in “Off-line” mode
  3. Disable contributed modules and switch to a core theme (Bluemarine or Garland).
  4. Remove all of the old files and directories from the Drupal installation directory.
  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.
  8. Re-install contributed modules.
  9. Run update.php by visiting /update.php

When I just attempted to upgrade, I leapt into step 6. So now starting again, following the above process

  3 comments for “Upgrading a Drupal Installation

  1. Webologist
    May 20, 2008 at 9:47 pm

    After getting my test zone working, I decided that the quickest way to upgrade Drupal would be to simply delete the current live directory;

    rm -rf livedirectory

    and then copy the test one over to the live one:

    cp -r test livedirectory

    I tried as first just copying over, but that did not work fully. I think one reason was the read only files in the live directory. These cannt be over-written (I think). Anyway, deleting and the copy over worked.

    Oh, before I deleted I di a backup, simply:

    cp -r live live_backup

    So that way if it all went tits up, then I’d still have the working live version.

    The only issue now is that the live directory is using the test database. So now I plan to finish the upgrade/transfer by importing a copy of the test MySQL database into live.

  2. Webologist doing Drupal
    May 20, 2008 at 10:00 pm

    Next step:

    Create a new back up of the installation (all files and database). Download and extract the files.

    Edit the settings.php file with the live database name. Delete the settings.php on the server, and upload a new one.

    Then drop the live database, and import the new one.

    Job done. If it goes wrong, just point the install to the test database again (modify settings.php) and have another go.

    Or just let your readers wait.

  3. Webologist doing Drupal
    May 20, 2008 at 10:13 pm

    Job complete. Test database imported to live with phpmyadmin. Result:

    “Import has been successfully finished, 626 queries executed.”

    So, what have i accomplished today?
    I started out with just a live version of Drupal 5.2. I created an exact copy of it in a test domain, and then copied the imported the live database into a test MySQL database.

    I then upgraded Drupal from version 5.2 to 5.7 in test. It all worked OK. So I then made a another backup of the my live site (to be sure) and copied the test site files over. It all worked OK. I then dropped the live database, and imported the test one, and updated the settings.php

    Result. I now have an updated live Drupal (version 5.7) and also an identical test version. When I am ready to upgrade to Drupal 6 or 7, I will do the same process.

    It may be a little long winded, but it is safe. If at any point something goes wrong, you have a working backup of the site at hand.
    Also I now have a playground to try out a few new modules for my site. Lovely.

Leave a Reply

Your email address will not be published. Required fields are marked *