Reposted from IYCC.org:

Before starting, it must be pointed out that this tutorial only applies to upgrading Drupal 5.7 to a later version other than Drupal 6. It is not necessary to upgrade 5.7 to the latest Drupal 6 for now, but do learn how when Drupal 5 becomes obsolete in the future. It is necessary, however, to update Drupal to the latest version because mainly of security issues that were found in previous versions. You may have noticed on Drupal.org that the latest Drupal 5, at the time of this writing, is 5.11 or when certain pages of your Drupal website is alerting you that Drupal needs to be updated. This tutorial will show you how to do just that. If you have learned to install themes and modules for Drupal, this shouldn't difficult for you to do. For this exercise you need to have your web server, a computer with a Linux terminal, and the Drupal website. You can perform the upgrade on Windows, but it will be different to what this tutorial says. Feel free to learn how to upgrade on Windows at your own pace.

With your web server running, log in to web server via terminal from your computer; at the same time, open a web browser to your website and go to the administers page after logging in as the administrator (remember, if you are the first user to have an account on the website, you are the administrator). If you have a theme running on your website other than Garland or Bluemarine, switch from the theme you are using to either Garland or Bluemarine at the themes' page. At the modules' page, make a list of the modules that are enabled on your website and deselect the modules installed except for the modules listed under “Core – optional” and “Core – required” you can leave those alone. Having either garland or bluemarine as the theme, and disabling modules other than the core, is for safety and lessen the chance of something going wrong during the upgrading process.

If your website is online, you need to take it off-line for the duration of the upgrade by going to the “Site Maintenance” page under the “Site configuration” at the administer page and select off-line radio button. You may need to put a notice on your site letting your users know that the site will be down for a time before conducting the upgrade especially when your website has high traffic. That way, users will be aware ahead of time and will not find themselves wondering why the site is suddenly off-line.

At the terminal where you are logged into the web server, make your way to the '/usr/share' directory after becoming the root user by typing (without the quotations):

“cd /usr/share/”

The should be a directory called 'drupal5' within the share directory of usr if you have Drupal installed by aptitude. Type 'ls' at the command line to see the 'drupal5' directory along with a list of files and directories in the share directory. Before anyone upgrades Drupal, it is imperative to have a backup of the current Drupal version in case of an emergency. Hopefully, you won't need it, but you'll be glad when you do. To make a backup of the 'drupal5' directory, type within the share directory:

tar -cvvf drupal.tar.gz drupal5/

The 'tar' command is archive utility program much like the familiar Zip files of Windows. The command above will compress the content of the drupal5 directory as drupal.tar.gz. You can choose another name if you wish but end it with '.tar.gz'. To learn more about the 'tar' command, type 'man tar' at the command line.

Now that we have a backup of the drupal5 directory, we can begin the upgrade. Copy the link of the latest Drupal version either from the status report page of your website (Administer page > Logs) or from the Drupal website. Both are the same link to a tar file. At the terminal, type 'wget' then press Shift + Insert at the command line:

'wget http://ftp.drupal.org/files/projects/drupal-5.11.tar.gz'

This will download the file to your web server. You should be familiar with this method because this is the same as downloading modules and themes. Next, with the file successfully downloaded at the share directory, type:

'tar -xzvf .*gz'

Again, you should be familiar to you, you use this command to uncompress the files for the modules and themes. Type 'ls' after uncompressing the tar file and you should see a new directory labeled 'drupal-5.11.' Go to that directory then to the modules' directory then type 'ls.' Look at the list of modules of Drupal 5.11. Do the names look familiar? Go to the modules' page of your website through a web browser and compare the names at that page to the ones on the terminal. Some should be the same. Now, for the upgrade. Type the following while in the modules' directory of 5.11:

'cp -R * /usr/share/drupal5/modules/'

This will copy recursively everything in the modules' directory of 5.11 to the drupal5 directory. In other words, this command will override the modules in drupal5 (5.7) with the modules of 5.11. Don't worry about the old modules; we have a backup, remember? Luckily, this all you need to do, but we are not done yet. At the address bar, type your website address followed by 'update.php,' for example:

http://www.yoursite.com/update.php

If you do not have a domain name, then type the IP address of your web server followed by 'drupal5/update.php,' for example:

http://192.168.1.101/drupal5/update.php

You will be taken to the 'Drupal database update' page where you click on the 'run the database upgrade script' then click the 'Update' button. This will update Drupal database in light of the new modules. You should not have problems running the upgrade script. After the script finishes, you can click the main page or administer page links, or type in your website address. You can check if the upgrade is successful, by going to the status report of your website (Administer > Logs) and look at the version of Drupal installed; you should see Drupal 5.11 not 5.7. Congratulations, your Drupal website is up to date. All you need to do now is re-enable the theme and modules of your site and bring the site back online.

Comments

Luis Cisneros Jr’s picture

Because if one were to install Drupal through aptitude, they will be installing the 5.7 version.