Drush and Maintenance Mode
We love Drupal here at Ferlito/van Der Wyk, but as soon as we get accustomed to a certain way of doing things with Drupal, it changes. Here's one example: using Drush to put a site into maintenance mode. This drush command puts a site into maintenance mode:
and putting it back online is just as easy:
This works great for Drupal 6, but the good folks at Drupal decided to change things up for D7. We are now using a new variable,
and to put it back online you need two commands:
Don't forget to do both commands or it won't work, the second one clears caches.
drush vset site_offline 1 --always-set
drush vset site_offline 0 --always-set
maintenance_mode. A value of 1 indicates the site is in maintenance mode, so for D7 we have this:
drush vset maintenance_mode 1
drush vset maintenance_mode 0
drush cc all

Comments
Post new comment