Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 318 Vote(s) - 3.6 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is it possible to take a Drupal site offline using Drush?

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

#2
theunraveler's solution is the best if you're running a single site. We were running a very large multisite drupal installation, with hundreds of sites. Taking them offline that way via drush takes several seconds per site which was unacceptable. The fastest way to take a site offline is to break the db connection by for example renaming the settings.php file. Then just assign a default theme that has a basic template that doesn't require the db, saying "Site Offline" or something. After upgrading you can just repair the settings.php file and you're good to go.
Reply

#3
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][1] on drupal.org, which will set your site to offline if it finds a specific file in the directory.


[1]:

[To see links please register here]

Reply

#4
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.
Reply

#5
With a site alias on D7:

drush @site_alias -y vset maintenance_mode 1 # Take site offline
drush @site_alias -y vset maintenance_mode 0 # Take site online
Reply

#6
It's quite easy in fact, simply set the variable of maintenance mode to 1 (0 to restore default value):

drush vset maintenance_mode 1
Reply

#7
Drupal 6

drush vset site_offline 1

Drupal 7

drush vset maintenance_mode 1

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through