These more-detailed directions expand on the short version, and provide step-by-step instructions on how to upgrade via the command line. In these detailed instructions, the new site is prepared on the web server. For people who don't want to work on the command line, the new site can be prepared on your local computer, and then uploaded to the web server via FTP.
Preparing the Upgraded Site
1. In the same directory as your existing site, create a folder named upgrade_temp.
2. Download the latest version of core Drupal from http://drupal.org/ project/drupal. Once you have downloaded the tar.gz file, use your FTP client to upload it to the upgrade_temp directory.
3. SSH into your server and cd to the upgrade_temp directory. -[361 ]-
4. Using the command line, extract the Drupal codebase:
tar -xzvf drupal_release.tar.gz
5. Delete the sites directory from the newly-extracted Drupal codebase:
rm -r path/to/new/codebase/sites
6. Using the command line, copy the sites directory from your existing site into the new codebase:
cp -pr /path/to/livesite/sites path/to/new/codebase/sites ^ ^^ On some operating systems, the command will need to be cp -pR J
At this point, the new codebase should be ready for the upgrade. To verify that all files have been copied to the right places, examine the upgrade_temp directory using ls -al at the command line or by navigating to the upgrade_temp directory using your FTP client.
Preparing the Codebase—Additional Notes
In some cases, your site will have a custom php.ini file, or a modified .htaccess file in the root of your Drupal install. If you have either of these modifications in your site, be sure to copy the modified files to your upgraded codebase.
Also, in very rare instances, the upgrade will include changes to the settings.php file. In this rare case, you will need to copy over the database name, database user, and database password from your old settings.php file. Editing the settings.php file is covered earlier in this chapter, where we described how to test your backup.
Bringing the Upgrade Live
1. Log in to your site as UID1.
2. Click the Administer | Site configuration | Maintenance link, or navigate to admin/settings/site-maintenance, and put your site into Offline mode.
3. Using your FTP client, navigate to the web directory on your server. Rename the folder containing the codebase for your existing site from foldername to foldername_old.
4. Using the command line, copy the upgrade_temp directory (which contains the new codebase) into the web directory, and rename it to match the foldername that was edited in step 3.
In some cases, there may be additional files stored within the web directory. If this is the case, you will need to delete the full Drupal codebase from the web directory, and copy the upgraded codebase into this directory. Both methods work perfectly well; however, one advantage of renaming the directories is that you have a working codebase on your server to roll back to if something goes awry during the upgrade process.
5. Navigate to http://yoursite.org/update.php. You will be presented with a wizard with four steps: Overview; Select Updates; Run Updates, and Review Log. Click the Continue button.
6. At the Select Updates screen, click the Update button. The update process will continue through without the need for additional input.
7. Once the upgrade process has completed, test your site by logging in as different users, adding sample content, and so on. Even if the upgrade process was generally uneventful, a little extra time verifying a clean upgrade is never a bad thing.
8. A best practice for upgrades involves a series of tests for users in different roles. For example, users in the teacher role would create an assignment in a group, view a student's assignments, and add a note about a student.
9. Once you have verified a clean upgrade, delete the foldername_old directory, and the upgrade_temp directory.
10. Click the Administer | Site configuration | Maintenance link, or navigate to admin/settings/site-maintenance, and put your site into Online mode.
11. Perform a master backup of your site as described earlier in this chapter.
Was this article helpful?