Location : Web Hosting - Web Hosting Knowledge Base - Drupal Tutorial

Manual upgrade drupal CMS

Drupal release new major versions every 9 to 12 months, and there are bug fix releases in between the major releases. Any website using drupal should follow closely of these releases to ensure security issues found are fixed appropriately, as well as keeping up to date of the features introduce in each major releases.

Apart from the regular upgrades on drupal core program, drupal website owners should also check through the addon contributed modules that has been installed in the website, there are security releases and major releases as well for these contributed modules.

In every upgrade attempt, before you even started doing anything, read through the notes in the upgrade release thoroughly to get an idea of what will be done in the upgrade process, certain upgrades may require some extra steps before performing the regular upgrade procedures. This is especially important when you are performing a major release upgrade. You should also check through latest news on the contributed modules that you are using in your drupal website, be sure there is no compatibility issues before performing the upgrade, otherwise you may have problem getting your drupal website to work after the upgrade.

In general, there are three major steps in performing a manual drupal upgrade :-

Backup drupal website and database

This is important and it can save you from a lot of trouble rolling back to a working condition should the upgrade failed, even though you are so familiar in using drupal, you should not skip this important step. You can refer to the cpanel guide on backup up entire website, and mysql database backup.

Quick steps :-

SSH login to your hosting account and goto the root of your drupal website.

enter command :-

cp -a drupal_site backup_drupal_site

where 'drupal_site' is your drupal site folder name, and the 'backup_drupal_site' is a new folder that will be identical to your 'drupal_site' after the copy process. This is a quick way to create a backup of a folder.

enter the following command to dump out your drupal mysql database into a text file, this is your drupal database backup.

mysqldump --database mysql_dbname > dumpfile.sql

Prepare new drupal program

Download the compressed drupal core program and unzip the files in a new folder in your hosting account :-

rename the existing drupal folder to another name, rename the newly extracted folder to the drupal folder name

copy the '.htaccess', 'settings.php' (***see NOTE below) file from the old drupal folder to the new drupal folder

copy the 'files' folder from the old drupal folder to the new drupal folder

copy any other files needed (i.e. contributed modules) from the 'backup' folder in old drupal folder to the new drupal folder, (i.e. contributed modules etc. Be sure to check each module to ensure they is not compatibility issues before copying, you might require installing a newer version of certain contributed module instead of copying from old.

NOTE: For drupal version older than ver 4.5, you should look for the includes/conf.php file, copy the following lines from the file and paste them into the settings.php in new drupal folder.

$db_url = mysql://user:pass@localhost/drupal_db';
$base_url = 'http://www.example.com';
$db_prefix = '';

These are basically the mysql database connection strings for drupal to connect to the mysql database correctly.

Run drupal upgrade script

The last step in drupal upgrade process is running the update.php script, this script will check and update drupal database if there is a need in the upgrade process. Be sure to login as USER 1 (the first user created after setting up drupal, also known as the drupal site administrator), then enter the URL to the update.php in browser window :-


After completing the process, be sure to check the messages in the screen to ensure everything is completed properly, or if there is anything that requires your attention.

Extra checking

After upgrade process completed, be sure to check through everything is running as expected, especially the customized work you have done on your drupal website. Also, check through the contributed modules you have installed in your drupal websites to ensure they are functioning properly, as well as double checking the latest news of these contributed modules to ensure there is no compatible issues and if there is anything that requires patches after upgrading the core drupal to the current version. These extra steps are important when you are performing a major release upgrades, there is generally a lot more changes to the drupal core than security bug fix releases, and some manual changes is expected if you have a highly customised drupal website.

Post upgrade steps

Login to drupal admin screen to enable new core modules if there is any and remember to also set proper user access permissions for these newly activated modules.

Finally, remove the following files from your drupal folder :-

* install.php

Congratulations ! you are done !