Return to doc.sitecore.com

3.  Adding a Domain
Prev Next

To add a new domain, perform the following three steps:

  1. Create a database for the new domain and register a connection to it in the web.config file.
  2. Register and configure a new database object in the web.config file.
  3. Register a new domain in the web.config file.

3.1.  Creating a Database

A new database for the domain may be copied from the existing one (extranet, for example) or restored form a clean backup.

We will call the new CopyExtranet database. After the new database is copied, we need to register a connection to it. See the code below for details.

<!-- CONNECTION STRINGS -->
    
<connections serverName="server" user="sa" password="12345" prefix="smar5119">
      
<archive>data source=$(serverName);initial catalog=$(prefix)Archive;user id=$(user);password=$(password);Connect Timeout=30</archive>
      
<core>data source=$(serverName);initial catalog=$(prefix)Core;user id=$(user);password=$(password);Connect Timeout=30</core>
      
<extranet>data source=$(serverName);initial catalog=$(prefix)Extranet;user id=$(user);password=$(password);Connect Timeout=30</extranet>
      
<master>data source=$(serverName);initial catalog=$(prefix)Master;user id=$(user);password=$(password);Connect Timeout=30</master>
      
<recyclebin>data source=$(serverName);initial catalog=$(prefix)RecycleBin;user id=$(user);password=$(password);Connect Timeout=30</recyclebin>
      
<security>data source=$(serverName);initial catalog=$(prefix)Security;user id=$(user);password=$(password);Connect Timeout=30</security>
      
<web>data source=$(serverName);initial catalog=$(prefix)Web;user id=$(user);password=$(password);Connect Timeout=30</web>
      
      
<!-- ADD A NEW CONNECTION HERE -->
      
<CopyExtranet>data source=$(serverName);initial catalog=CopyExtranet;user id=$(user);password=$(password);Connect Timeout=30</CopyExtranet>
    
</connections>

3.2.  Registering a New Database

Add the following lines to the sitecore/databases section of the web.config file to register the new database object.

<database id="CopyExtranet" singleInstance="true" type="Sitecore.Data.Database, Sitecore.Kernel">
        
<param desc="name">$(id)</param>
<dataProviders hint="list:AddDataProvider">
            
<dataProvider ref="dataProviders/templatefile" param1="/sitecore/shell/Security templates.xml"/>
            
<dataProvider ref="dataProviders/main" param1="$(id)"/>
        
</dataProviders>        
        
<securityEnabled>false</securityEnabled>        
        
<archives hint="list:AddArchive">
            
<archive path="archives/archive[@id='recyclebin']"/>
        
</archives>
      
</database>

3.3.  Registering the Domain

Register the domain in the web.config file. Add the following lines to the sitecore/domains section.

      <domain id="OtherExtranetDomain" singleInstance="true" type="Sitecore.SecurityModel.Domain, Sitecore.Kernel">
        
<param desc="name">OtherExtranetDomain</param>
        
<param desc="database">CopyExtranet</param>
      
</domain>

3.4.  Alternative Data Storage

Sitecore is database neutral. Different domains can work with different database types.

To add a domain which works with an alternative database, you should perform the steps described above and register the data provider definition in the web.config file.

Consider the case when all of your domains work with MS SQL databases and you need to add a domain which uses the FireBird database.
The following changes of the web.config file are required:

  1. Create and register a new FireBird database. Add the following code to the sitecore/conections section:

    <FirebirdExtranet>Database=/data/scExtranet.fdb;
    User=SYSDBA;Password=masterkey;ServerType=1;
    Dialect=3;Charset=UNICODE_FSS;</FirebirdExtranet>

  2. Add a new dataprovider definition to the sitecore/dataproviders section:

    <fb type="Sitecore.Data.Firebird.FirebirdDataProvider, Sitecore.Firebird">
     <param ref="connections/$(1)"/>
    </fb>

  3. Add a database object to the sitecore/databases section:

<database id="FirebirdExtranet" singleInstance="true" type="Sitecore.Data.Database, Sitecore.Kernel">
        
<param desc="name">$(id)</param>

        
<dataProviders hint="list:AddDataProvider">
          
<dataProvider ref="dataProviders/templatefile" param1="/sitecore/shell/Security templates.xml"/>
          
<dataProvider ref="dataProviders/fb" param1="$(id)"/>
        
</dataProviders>        
        
<securityEnabled>false</securityEnabled>        
        
<archives hint="list:AddArchive">
          
<archive path="archives/archive[@id='recyclebin']"/>
        
</archives>
      
</database>

    4. Add the new domain:

      <domain id="FirebirdDomain" singleInstance="true" type="Sitecore.SecurityModel.Domain, Sitecore.Kernel">
        <param desc="name">$(id)</param>
        <param desc="database">FirebirdExtranet</param>
      </domain>


Prev Next