Applying Security Updates to Drupal 7
The standard method of applying security updates to Drupal 7 is to download the latest version from drupal.org and follow the instructions in the UPGRADE.txt file. For years this has been the only way to upgrade Drupal across minor versions. If you are upgrading to Drupal version x.y, then x is known as the major version number, and y is known as the minor version number. The download file will be named drupal-x.y.tar.gz (or drupal-x.y.zip).
BEFORE UPGRADING DRUPALThe most important thing to do before upgrading Drupal is to make a backup of your website or blog before you begin. This is done in two steps:
- Make a backup of the database by exporting it. PhpMyAdmin is a helpful tool in getting this done.
- Copy the entire Drupal directory. Compressing it into a zip file is usually a good way to go.
PATCHING DRUPALFor persons using CentOS or Fedora here’s a super easy way to Applying Security Updates to Drupal 7. Using the patches below you can upgrade across minor versions in a single step instead of downloading and installing the newest complete Drupal release. To apply the patch to Drupal you must first download the correct version that matches your installation. Next, ensure that your UNIX server has the patch utility installed. This can be installed by running:
// execute at the terminal sudo yum install patch
Now, from the terminal navigate to the Drupal root folder using
To test the patch utility before attempting the upgrade run:
// Dry run for testing without modifying anything patch -p1 --dry-run < drupal-7.39-to-7.66.patch // Do the real patching: patch -p1 < PATCHFILE
After upgrading, run update.php to take care of any database upgrades that may be required. That's it!