Update drupal to 6.x

Again a blog post to make sure my mind can remember what needs to be done… in case I want to update a drupal installation. As a source I used the video on http://www.masteringdrupal.com/screencast/upgrading-to-drupal-6. The text below is a summary of that video.

Note: If you want to upgrade from drupal 4.x, then first upgrade to 5.x. Only then start to follow this guide.

Some advice

Let us start with some well meant advice:

  • Do a lot of reading (documentation of the installed modules, drupal update manual, etc.)
  • Make backups (drupal folder, database, etc)

1. Backup procedures

Before the actual upgrade we make sure that we can restore the website if the update fails. This we way are sure that we do not loose important information during the update process. Follow these steps carefully and add all steps that you think are missing. Remember; better a backup to many, then a backup to little!

  1. First we backup all the files of the website. Use your favourite ftp client (or use other means to connect with your server) and download all files in the drupal folder. Store this backup securely!
  2. Secondly backup the database. Depending on the access you have to the database you can either try to  login directly and download a backup, use PHPMyAdmin (http://www.phpmyadmin.net), or use the backup and migrate module (http://drupal.org/project/backup_migrate). Also store this file securely!

2. Preparations

Before we start we prepare our installation for the upgrade

  1. Check the logs for errors. You can find the logs under: ?q=admin/reports/dblog
  2. Check all your modules Find them under: ?q=admin/build/modules Make sure that you disable and uninstall the Update status module if you have it.
  3. Upgrade all modules to the lastest versions (5.x versions) To be clear; do not update them to the 6.x version, but only to the 5.x version.
  4. Disable and remove all modules that you want to stop using. This includes the modules which are not available for drupal 6.x
  5. Make sure you update all the database tables. Do this by going to: www.yourdomain.com/update.php and follow the steps. Make sure that the shown report does not contain any errors.
  6. Login as user number one (the user that was the first admin of the system).
  7. Set the website theme to a standard theme (as we do not know yet if your 5.x theme will work in drupal 6.x)
  8. Set the website into off-line mode Find it under: ?q=admin/settings/site-maintenance

3. The upgrade

Now it is time to upgrade drupal and your website. Make sure that you have a (tested and working) backup of your website before you continue.

  1. Remove from the drupal folder all files and folders except the ./sites, the ./files, and the ./.htaccess
  2. Place the new 6.x files in the drupal folder. This all files are now updated to the new version.
  3. Remove all old versions of your modules from the ./sites/all/modules folder.
  4. Place the new (6.x versions of your) modules into the ./sites/all/modules folder.
  5. Again update all the database tables. Do this by going to: www.yourdomain.com/update.php and follow the steps. Make sure that the shown report does not contain any errors.

4. Basic checks and theming

The drupal and the database are now updated. It is time to check the new website.

  1. Go to the status-report and check for any notifications
  2. I do recommend you to enable the Update status module Find them under: ?q=admin/build/modules
  3. Check if you have the latest versions of the modules, if not return to step 3.4
  4. Test your theme. If it works, enable it. If not, update it to work with drupal 6.x
  5. Put your website in on-line mode Find it under: ?q=admin/settings/site-maintenance
  6. Now click around on your website. Check all settings and make sure everything works. Try also all links and functionality as a user with other permissions.

5. Finally

Be happy with the result and thank the drupal team for their efforts!