13

I have 4 Drupal sites that have nothing to do with each other, except that they all run on Drupal and they're all managed by me.

The modules each site needs will vary, but they probably share some small subset of modules.

Is this situation a good candidate for using multi-site configuration?

What if I want to add a fifth site? How would I upload the new one, or how would that work?

11

Multi-site setups are a little tricky due to their reliance on the same codebase. You can use a multi-site setup in this scenario, but bear in mind that when you upgrade a module in sites/all/modules, it'll affect all the sites (unless overridden in sites/$SITENAME/modules).

This leads to potential issues where one of your sites relies on N version of a module, but you want to use N+1 on another site. The module in question might not have an upgrade path, or it might've drastically changed its functionality between versions (not as uncommon as you might think, given Drupal culture towards major versions).

Additionally, if there are critical database changes needed during a module upgrade, you'll find that you need to take down multiple sites at the same time to ensure you run update.php.

So for most use-cases, multi-site isn't the way to go. Unless you're really strapped for space or you have some weird hosting restriction that prevents you from mapping each site's domain to a separate folder, you're likely better off maintaining separate code bases and using tools like Drush and version control to speed up code deployment.

The prototypical use-case for multi-site, outside of its use as a workaround for restrictive hosts, is when you're deploying a ton of sites that are extremely similar. You might be running a hosting service, or building a bunch of micro-sites for a company, or what-have-you. In those cases, you can roll your own multi-site setup, but you should also consider using Aegir, which automates and abstracts a lot of the hassles of running such a set-up.

Adding new sites to a multi-site setup is pretty straightforward: create a new folder under sites, edit sites/sites.php (Drupal 7 only), copy sites/default/default.settings.php to settings.php in that new folder, and visit the site in a browser. Drupal should begin the installation process and use the new folder. Your new site will have access to all the modules under sites/all/modules just like your exiting sites.

  • That's pretty cool. This is actually kind of related to my other question about symlinks and the modules folder. I'm tired of having to repeat the same routine everytime I start a new test site on my devel environment, and I'm also pretty sick of copying modules (especially custom modules) to multiple projects (complicates updating). So I guess I could use the multi-site approach, at least during development. – sameold Jun 4 '11 at 2:25
  • @sameold what I use for Drupal development is a git repository that contains my must-use modules as submodules. Then it's just a matter of running git clone git@my.repository.com:/base.git newsite to get a clean environment. – user7 Jun 4 '11 at 2:55
  • 4
    An alternative would be a drush make file for the basic setup. Another minor note, editing sites/sites.php is optional and only necessary when the default lookup like it was in D6 doesn't work (e.g. multi-site with multiple domains for a single site). – Berdir Jun 4 '11 at 7:50
2

I would use a Multi site where you have a related content offering but for different audiences.

For example we use it for our Intranet which supports multiple brands. This allows each brand to be administered individually with an option to share content / users (huge time saving on reducing duplication).

Also having a unique interface (menus/blocks/themed) goes a long way in ensuring different departments can easily access what is most important to them.

Lots of features are available using Domain Access such as allowing a user to set their default site, different sites by sub domain (So you could have marketing.intranet.local or engineering.intranet.local etc), search between sites, access control etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.