Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to take a Drupal site offline using Drush?

Tags:

drupal

drush

Is it possible to take a Drupal site offline using Drush?

like image 487
markdorison Avatar asked Oct 28 '10 18:10

markdorison


2 Answers

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.

like image 73
theunraveler Avatar answered Oct 03 '22 23:10

theunraveler


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.

like image 25
Horatio Alderaan Avatar answered Oct 03 '22 23:10

Horatio Alderaan