How to install security updates in Drupal sites

| | 2 min read

Security updates are essential in Drupal websites. Such updates are vital to address certain security vulnerabilities and keep your website protected from potential threats.

You can get the details of the Drupal security updates that need to be applied on the Drupal site from the link given below: http://www.buildamenu.com/admin/reports/updates.

Steps to install Drupal Security Updates

  • Check available updates.

     drush ups 
  • Check for hack details using meld module. You can install the meld module using

     sudo apt-get install meld 

    and just type meld in the command to check the differences in the files and directories.

If hacks are found, please proceed below, or else create patches for the hacks and proceed.

  • Delete the current version of the module.

     git rm -r sites/all/modules/module_name 
  • Download the new version of the module.

     drush dl module_name 
  • Add the new version of the module.

     git add sites/all/modules/module_name 
  • Commit the module updates to the version control system if added.

     git commit -m "security update for module_name module" 

If patches are present:

  • Update the patches for the hacked modules and add the patch.

     git add sites/all/PATCHES.txt 
  • Commit the patch to the version control system, if added

     git commit -m "comment wrapper template patch applied to module_name module" 
  • Run the database update script.

     drush updb 

Also, you can skip all the above steps and use directly the command given below to update after checking the hacked details using meld module.

 drush up module_name 

It's always good to follow the above steps if security updates are being done in the server directly instead of shortcuts.

You may also be interested in other articles related to Drupal security. If you have any thoughts or questions, please feel free to share them with us here. And if you're looking for Drupal development and consulting services, be sure to check out our offerings and take the first step towards building a successful career in Drupal.