Drupal 7: Updating the Core
These steps tell you how to update Drupal core. For example, when Drupal moves from 7.41 to 7.42, that's a core update. If you are set for e-mail updates, you'll know about it. For the OSTraining video, see Update Using cPanel.
Caution: You cannot simply overwrite your Drupal installation—in other words, wipe out your older code and replace it with the newer. You do not want to overwrite the existing sites folder, or the .gitignore or .htaccess files.
- To begin, back up your existing Drupal installation first:
- Go to your cPanel.
- Select public_html in the right panel.
- Click Compress and select .gz.
- Select the resulting .gz and copy it to your local computer.
- You will also want to back up your database. See backing up a Drupal database.
- Before you begin the update process, put your Drupal site into maintenance mode: Configuration > Development > Maintenance mode. Click Put site into maintenance mode , then Save configuration.
- When you know that a new release of Drupal has been occured, go to Reports > Available updates. To save some hassle, click on the new release number. For example, if you are updating from 7.41 to 7.42, click on 7.42.
- If you followed the preceding step, you'll go to a drupal.org site. Download the .gz file corresponding to the new release to your own computer.
- Go to cPanel/File Manager for your account, and upload the .gz file to public_html. Make sure you are in public_html. (For the spring 2017 course, the URL is http://184.108.40.206/ followed by a tilde and your account, for example, http://220.127.116.11/~etwr2479/
- Now, still in File Manager, select the .gz file and click Extract to unzip it.
Note: This will create a separate folder. For example, if you had initially installed 7.41, you will now have a 7.42 folder at the same level. (Make sure you don't have the earlier .gz file in public_html.)
- Select all the new Drupal core files (in this example, drupal-7.42) except for:
and move them to the folder originally containing the old Drupal core files (in this example, drupal-7.41).
- Run the update.php commmand in the web page for your Drupal site. For example, http://18.104.22.168/~etwr2479/update.php.
- To ensure this action worked, access this URL (assuming you updated to 7.42): http://your_url/~your_account/. (You know that index.html displays a site without typing it; index.php is functioning the same way—no need to type it.)
- Double-check your new installation in a web browser, remembering to use the new release number: for example, assuming you are updating to 7.42, use this URL: http://your_url/~your_account/
- Now you take your Drupal site out of maintenance mode: Configuration > Development > Maintenance mode. Uncheck Put site into maintenance mode , then Save configuration.
- Now, take a look around your Drupal site to see if everything looks the same.
Note: Updating Drupal core does not update the contributed modules and themes you have downloaded and installed. Drupal sends you separate notices on that; plus you can go to Reports > Available updates to see what's new.
Programs and information provided by email@example.com.