When running a multi-site installation, how can I optionally:

  1. Place all sites globally into offline maintenance mode, so I can do a core update?
  2. Place only one site off-line, so I can updates its custom modules?

Comments

cog.rusty’s picture

Essentially setting a site off-line means setting the variable 'site_offline' to 1 in the site's database in the 'variable' table. Normally this is done in the settings/site-maintenance page of each site, but you could do it directly in the database.

If you find this easier, you can add a $conf['site_offline']=1; line at the end of each site's settings.php file, to override the value of the variable.

If the sites are too many, it shouldn't be very hard to write a script which makes the changes either to the databases or to the settings.php files of the sites that you want, and another one to reverse the changes.

iantresman’s picture

Thanks for that. I was hoping that the Drupal core "default" site might override all the other multi-sites. This sounds like it is best suited to a module, as I don't fancy doing this manually.

I'll see whether the "Multi-site how-tos" gives some clues.

I've subsequently notice that the upgrade process is not as simple as I thought, hoping that updating the core default installation would update all the other multi-sites, but it seems that you still have to run update.php on each one. Kind of defeats the object.

cog.rusty’s picture

True, each site's database must be updated. If you have shell access to your server, you may want to check the drush module (not exactly a module, rather a multipurpose script for managing drupal sites). It updates sites in an instant.

http://drupal.org/project/drush
http://drupal.org/node/477684 -- Documentation page.

iantresman’s picture

The Domain Access module might be a solution, "a suite of modules that provide tools for running a group of affiliated sites from one Drupal installation"

francewhoa’s picture

The following 2 modules are able to do that

DRD uses visualization and click. Drush uses command line.

DRD is available only for Drupal 7 (master) but is able to monitor and maintain both Drupal 6 and 7 sites (slaves)

Loving back your Drupal community result in multiple benefits for you