Skip to content

Instantly share code, notes, and snippets.

@quimic-gist
Last active August 29, 2015 14:11
Show Gist options
  • Save quimic-gist/30acfe9386dcc8bcd2f0 to your computer and use it in GitHub Desktop.
Save quimic-gist/30acfe9386dcc8bcd2f0 to your computer and use it in GitHub Desktop.
Drupal: Update core if security update
#Put site in maintenance mode
drush vset maintenance_mode 1
#Enable updates
drush en update -y
#run cron
drush cron
#refresh update status
drush rf
#Lists security updates
drush vset update_check_disabled 0 -y && drush -n -p up --security-only
#clear cache before backup
drush cc all
#If code is version controlled, backup db is enough
drush sql-dump --result-file=../before-security-update.sql --gzip
#If not, make full backup (code + db)
drush ard
#Now update core
drush up drupal
#Disable updates if you want
drush dis update -y
#Put site back out of maintenance
drush vset maintenance_mode 0
#Add changed files to version control
git add CHANGELOG.txt
git add themes
git add modules
git add profiles
git add includes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment