This documentation relates to CiviCRM version 3.2. It's not maintained anymore.
Current version of documentation.

Multi Site Installation

Skip to end of metadata
Go to start of metadata

This page refers to outdated version of CiviCRM. Check current version of documentation.


Documentation Search


CiviCRM 3.2 Documentation

Support and Participation

Developer Resources


CiviCRM book!

Make sure to check out Understanding CiviCRM as well! You can also support this project by ordering a hard copy.

N sites with 1 CiviCRM Database

1. Single / First site installation

Say site1.example.com which would be same as any other normal civicrm installation. Before visiting any civicrm url enable multisite by modifying civicrm_settings.php

To

NB - you may need to add this line if your site started out as an early CiviCRM version as the civicrm_settings.php file is not normally changed when you upgrade.

2. Insert a new domain record in civicrm db. For example
3. Build navigation links for new domain/site

Modify civicrm_codebase/sql/civicrm_navigation.mysql file and specify new domain, e.g

To

And import this file to your civicrm db

4. Locate sites directory

Setup another site on drupal say site2.example.com. This will create sites/site2.example.com/ directory in drupal.

5. Locate civicrm settings file for site2

Depending on how you would like to install civicrm for site 2, you could proceed to step A OR B.

A. Manual CiviCRM installation for site2.example.com.

  • Copy civicrm settings file from previous site (site1) to the new site (site2).
    Note sites/site2.example.com/civicrm.settings.php is your new settings file which needs to be modified.
  • The sites can share a single instance of the civicrm code in sites/all/modules/ directory.
  • Modify sites/site2.example.com/civicrm.settings.php file to adjust settings like CIVICRM_TEMPLATE_COMPILEDIR, CIVICRM_UF_BASEURL as per new site.

B. Auto + Manual CiviCRM installation for site2.example.com

  • Use civicrm installer for installing civicrm for site2.example.com. Specify a new civicrm db which can be dropped later.
    Note sites/site2.example.com/civicrm.settings.php is your new settings file which needs to be modified.
  • Adjust CIVICRM_DSN setting to use the civicrm db used by site1. Drop the new civicrm db created in Step B.
  • The sites can share a single instance of the civicrm code in sites/all/modules/ directory.
6. Enable multi site for second site

Modify located civicrm.settings.php file (for site2) to change following line -

To

7. Register new domain / site

Modify located civicrm.settings.php file (for site2) to change following line -

to reflect the id of inserted domain record in step2. Assuming id is 2 for newly inserted record, the line would change to -

8. Register domain/site group

In multi-org installation, it is required to have a top-level org/group to represent the multi-org hierarchy root. When you login to the site and go to "manage groups" screen, you will notice a group with the name as that of domain. System requires you to register this master group responsible for holding sub-groups/contacts. You need to set a different group for each site (including the master site). So edit CiviCRM_settings.php for each site as below.

You can either edit this group or create your own group and register that. To register modify civicrm.settings.php file (for site2) to change following line -

To

Assuming master group id is 2

9. Associate an organization with the master group

To represent a multi-org hierarchy, an organization could be connected to the master group (one-to-one relationship).
The organization contact holds information about the organization itself (name, location, etc.) and the associated master group holds other sub-groups/contacts related to that group (employees, alumni, online activists, members, etc.).

To register the organization,
1. Create an organization contact. _Should the Organisation contact be created via the master or associated child site? Is this significant?_2. On "manage groups" screen, go to master group's settings page, and associate the organization created.
3. Modify civicrm.settings.php file (for each site including the master site) to change following line -

To

Assuming organization contact id is 2

10. Configure same UF account for all N sites (having same email address), be mapped to different civicrm contact -

The default behavior for this case is to map the drupal account having same email address for N sites with same/one civicrm contact.
In case you would like a separate civicrm contact to be mapped/created for each of the site, modify civicrm.settings.php file to change following line -

To

11. Configure Access Control to restrict users on Site N to contacts in Site N's Site Group

There is a separate Drupal module called multisite that automatically implements CiviCRM access control for multi-site installations, such that normal users on Site N are restricted to contacts in Site N's Site Group. Note that users with permission to view or edit all contacts bypass this access control. As of CiviCRM 3.0.2 this is not part of the CiviCRM tarball but is available through svn.

Labels
  • None

Creative Commons License
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-Share Alike 3.0 United States Licence.