Hide menu Last updated: Sep 21 2015

Installing and configuring mirroring

Mirroring usually occurs between two sites, so you have to install two sites: one as a source site and one as a target site. You can use each site as a source site or a target site regardless of the purpose from the beginning.

The installation package for Episerver contains a setup file (setup.exe) that installs the Deployment Center and Episerver CMS. Alternatively, you can run EPiServerShared.msi and EPiServerCMS.msi instead of the setup file.

Note: You can install mirroring only on Episerver CMS 7.5 (through the Deployment Center). If you want mirroring with the latest Episerver version, install a CMS 7.5 site with mirroring, and then upgrade to the latest CMS through NuGet because there is no NuGet package for mirroring functionality; it is installed as a separate service in a virtual directory on the server. An updated DLL is available in the EPiServer.CMS.Core NuGet package (packages/EPiServer.CMS.Core.9.0.0/tools/MirroringService/), which you must manually patch to support CMS 9.

Note: Episerver CMO and Episerver Commerce do not support mirroring. Also, content mirroring is not supported in a cloud deployment such as Windows Azure Web Apps and Episerver Digital Experience Cloud (DXC).

Installing mirroring on a new website

  1. Open the Deployment Center and select Install site and SQL Server database or Install site without database, depending on whether you want to use SQL Server as a database. The mirroring part of the site is installed as an application under the site/application with a separate application pool. You can change this manually after the installation if you want to have the mirroring application on a separate site.
  2. In Web server bindings, select the site settings and bindings for the site you are creating.

  3. Creating database. Select settings for the database to be created.
  4. Virtual Path Provider Folder. Select a folder where files will be stored by the Virtual Path Providers.
  5. Modules. Select Install Mirroring in the module list.
  6. License file. Browse to a valid license file. If you do not have a valid license file yet, you can copy the file to the site when received.
  7. Summary. Check that the port in Bindings under Site Settings is 80.
  8. Credentials. At the end of the installation, the mirroring module window appears where you select the credentials that are used when you run a mirroring job. These settings are editable from the mirroring configuration file (web.config). Enter the username, password, and domain of a user that exports and imports pages and files when you run a mirroring job.

Installing mirroring on an existing website

To install Mirroring on an existing Episerver CMS site, the site must be running on the same version as the mirroring DLL (EPiServer.MirroringService.dll).

  1. Open the Episerver Deployment Center, and select Install Mirroring to start the installation.
  2. Choose site. Choose the site on which you want to install the mirroring application. Only sites installed on port 80 are visible and selectable.
  3. Credentials. At the end of the installation, the mirroring module window appears where you need to select the credentials that are used when you run a mirroring. These settings are editable from the mirroring configuration file (web.config). Enter the username, password, and domain of a user that exports and imports pages and files when you run a mirroring job. 
  4. Summary. Displays the settings. Check all settings before continuing with the installation.

Configuring the target site

Create a page that acts as the root page for the mirrored pages on the target site in the Episerver CMS editorial interface. You also can use an existing page as the mirroring root page.

Configuring the source site

Creating a channel

Create and edit channels on the source site for mirroring in the Episerver CMS administrative interface. See the section about configuring mirroring in the Episerver CMS User Guide.

Mirroring channels

Start the mirroring process manually, or automatically as a scheduled job, in the Episerver CMS administrative interface. See the section about running the mirroring service scheduled job in the Episerver CMS User Guide.

Configuring web.config

Changing Security Credentials

To change the security credentials that are used when a Mirroring job is run, open web.config for the source mirroring application. Locate the episerverMirroring element in the configuration file and change the credentials in the MirroringTransferServer provider.

C#
<episerverMirroring>
   <mirroringTransfer defaultProvider="MirroringTransferServer">
       <providers>
           <add 
               defaultEndpointName="mirroringTargetEndPoint"
               numberOfPagesInPackage="500"
               numberOfFilesInPackage="100"
               destinationPath="c:\temp\mirroring\"
               chunkSize="4194304"
               name="MirroringTransferServer"
               type="EPiServer.MirroringService.MirroringTransferProtocol.WCF.MirroringTransferClient,EPiServer.Enterprise"
               username="XXXX"
               password=""
               domain="ep" />
               sourceConnectionStringName="" />
               destinationConnectionStringName="" />
         </providers>
       </mirroringTransfer>
   <mirroringMonitoring offlineLoggningEnabled="true" offlineLogPath="Path to offline log"/>
</episerverMirroring>
ConfigurationDescription
defaultProvider To use a mirroring provider other than the built-in provider, enter the provider in the episerverMirroring section and set the defaultProvider to the provider you want to run.
numberOfPagesinPackage Indicates the max number of pages in package. Default: 500.
numberOfFilesInPackage Indicates the max number of files in package. Default: 100.
destinationPath When data is sent between the machines, temporary files are stored in the destinationPath location.
chunkSize The chunk size of data sent between the machines. Default: 4194304 bytes. 
communication protocol When the mirroring application is installed, it uses basicHttpBinding by default when communicating between the machines. To change this, change the bindings in the configuration files for both the source and the target application, see About WCF and Bindings on MSDN.
sourceConnectionStringName The mirroring provider uses the connection string from the connectionStrings section, by default. 
destinationConnectionStringName The mirroring provider uses the connection string from the connectionStrings section, by default. 
offlineLoggingEnabled Indicates whether offline logging is enable. Default is disabled (false); enable by setting to true.
offlineLogPath Indicates the path to the offline log. Default is C:\Windows\Temp\episerver\cms6\mirroring\monitoring\
XML
<episerverMirroring>
    <mirroringTransfer defaultProvider="myMirroringProvider">
       <providers>
          <add 
                 defaultEndpointName="mirroringTargetEndPoint"
                 destinationPath="c:\temp\mirroring\"
                 chunkSize="4194304"
                 name="MirroringTransferServer"
                 type="EPiServer.MirroringService.MirroringTransferProtocol.WCF.MirroringTransferClient,EPiServer.Enterprise"
                 username="XXXX"
                 password=""
                 domain="ep" />
          <add
                 name="myMirroringProvider"
                 type="jobe.MirroringProvider, XXXX.Providers" />
       </providers>
    </mirroringTransfer>
  <mirroringMonitoring offlineLoggningEnabled="true" offlinelogPath="Path to offline log"/>
</episerverMirroring>

Changing the mirroring application to a separate site

The Deployment Center installs the mirroring application as an application under the chosen Episerver CMS site. To change the mirroring application to a separate site:

  1. Add site in IIS.

    Open up IIS and delete the mirroring application under the source and target sites. After the application is deleted, create a new site and set its root folder to the Mirroring folder that was created as a sub-folder to the source/target site’s root folder.

    Note: This document does not contain information about how to use WCF and basicHttpBinding on another port than 80. For details about configuring namespace reservations using a port other than 80 for WCF application hosted in IIS, see Microsoft MSDN.

  2. Change service endpoints.
    Open the configuration files, and update both the source and target mirroring sites (mirroringSourceEndpoint and mirroringTransferEndpoint) to point to the correct address.
<endpoint address="http://site1Mirroring/MirroringSourceServer.svc" name="mirroringSourceEndpoint"...
<endpoint address="http://site1Mirroring/MirroringTransferServer.svc" name="mirroringTransferEndpoint"...

 

Configuring the transfer provider act both source and target provider

Set sourceConnectionStringName and destinationConnectionStringName attributes on the provider to make the mirroring service provider act both as source and target.

C#
<connectionStrings>
    <add 
        name= "sourceDB" 
        connectionString="" />
    <add 
        name= "destinationDB" 
        connectionString="" />
</connectionStrings>
C#
<episerverMirroring>
   <mirroringTransfer defaultProvider="MirroringTransferServer">
       <providers>
           <add 
                ....
               sourceConnectionStringName="sourceDB" />
               destinationConnectionStringName="destinationDB" />
         </providers>
       </mirroringTransfer>
   <mirroringMonitoring offlineLoggningEnabled="true" offlineLogPath="Path to offline log"/>
</episerverMirroring>

Synchronizing mirroring

Synchronize the bin folders both under the site root folder and mirroring service bin folder. When assemblies in the site bin folder and mirroring service bin folder are not same, the following error appears during Check System:

System.Exception: Value cannot be null.
 Parameter name: type ()

You should have both bin folders synchronized with each other, because the Mirroring Service runs as a separate application and has its own application pool. When you add any custom code/property/module under the source site, copy the affected assembly to the Mirroring Service bin folder also. If you installed mirroring service on both source and destination sites, then Site and Mirroring Service must have the same assemblies under the bin folders.

Related topics

Comments