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:
drush vset site_offline 1 --always-set
and putting it back online is just as easy:
drush vset site_offline 0 --always-set
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, maintenance_mode. A value of 1 indicates the site is in maintenance mode, so for D7 we have this:
drush vset maintenance_mode 1
and to put it back online you need two commands:
drush vset maintenance_mode 0
drush cc all
Don't forget to do both commands or it won't work, the second one clears caches.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.