The following will describe how to update an existing CiviCRM installation to a new version. Always make sure you backup the database and the plugin folder, before proceeding.
Download the latest Civi (for drupal in this case) to your plugins folder (or any other folder).
Note: When upgrading from 4.0.1 do not upgrade to 4.5 in one go. I found that this breaks your civi installation with an error:
Fatal DB error, exiting, seems like your schema does not have civicrm_setting table
Restore a backup from your civi module folder and download 4.1:
wget "http://sourceforge.net/projects/civicrm/files/civicrm-stable/4.1.5/civicrm-4.1.5-drupal.tar.gz/download" -O civicrm-4.1.5.tar.gz
Extract and run the update (same url as described below) and then upgrade to 4.5.8.
Extract (this will overwrite the Civi folder if you downloaded this in the plugins folder, so make a backup!)
tar xzvf civicrm-4.7.19-drupal.tar.gz
Next run the upgrade…
When you don’t have clean url’s enabled
With clean url’s enabled
After the upgrade there is a message popup saying to delete a file (possible exploit), for those who missed that: