Is it possible to take a Drupal site offline using Drush?
Yep. drush vset site_offline 1
will set it offline, then drush vdel site_offline
will bring it back.
Alternatively, you can check out my Maintenance File module on drupal.org, which will set your site to offline if it finds a specific file in the directory.
Just in case anyone needs to do this with Drupal 7, the commands are:
drush vset maintenance_mode 1 --yes # Take site offline
drush vset maintenance_mode 0 --yes # Put site back online
It also helps to add a little drush cc all
after each of those commands to ensure that the change appears instantaneous to users.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With