[Drupal] How to update your Drupal site quickly using Drush and Hacked module

| | 2 min read

As the World wide web is starting to resemble the wild wild west, you have to ensure that your Drupal site is always up to date. If you are ignoring the security updates of Drupal, then you are simply making your Drupal site vulnerable to the worst enemy of all - Negligence. Updating a Drupal site requires time and effort which is why most people ignore it. Here is a quick way to update your Drupal site using Drush and Hacked module.

We had recently done a string of Drupal updates on some sites and they went pretty smoothly without any hassle. This is possible if you use Drush and the Drupal Hacked module. Here are the steps you have to follow to update your site with Drush.

Note: Before performing any major changes on your Drupal site, remember to take a complete database backup of your site and if possible a codebase backup using a VCS

Steps to update Drupal using Drush

Install Drush. To check any of the module or core is hacked, you can use the Hacked module.

Download and enable hacked module using the following command.

drush dl hacked
drush en hacked

Now to find the status of modules and Drupal core run the following command.

drush hlp

To compare the current version of the module in your site, with the one downloaded from www.drupal.org, run the following command.

drush hacked-details 'module name'

To find the difference between the files use the following command.

drush hacked-diff 'module-name'

If you don't need to update the modified modules, lock them using the following command.

drush hacked-lock-modified

Run the following command to update.

#Update all update available modules other than locked modules.
drush pm-update
or
#Update specified module only.
drush up 'module-name'

After update you can disable hacked moule using

drush pm-disable hacked

Reference:

  1. http://fuseinteractive.ca/blog/hacked-module-drush-integration

We would love to hear your feedback regarding the article. Please use the comments form below