HomeDev GuideRecipesAPI Reference
Dev GuideAPI ReferenceUser GuideLegal TermsGitHubNuGetDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

Install and configure mirroring

Describes how to install and configure mirroring.

📘

Notes

This content applies to Optimizely Content Management System (CMS) versions 10 and 11.

You can install mirroring only on Episerver CMS 7.5 (through the Deployment Center). If you want mirroring with the latest CMS 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 10.

Optimizely CMO and Optimizely Customized Commerce do not support mirroring. Also, content mirroring is not supported in a cloud deployment such as Windows Azure Web Apps and Optimizely Digital Experience Platform (DXP).

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

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

Install mirroring on a 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. You install the mirroring part of the site as an application under the site or 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. Web server bindings – Select the site settings and bindings for the site you are creating.
  3. Creating database – Select settings for the database you want to create.
  4. Virtual Path Provider Folder – Select a folder where Virtual Path Providers store the files.
  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, 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 displays where you select the credentials you use when running 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.

Install mirroring on an existing website

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

  1. Open the Optimizely Deployment Center, and select Install Mirroring to start the installation.
  2. Choose site – Choose the site where 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 settings before continuing with the installation.

Configure the target site

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

Configure the source site

  • Create a channel – Create and edit channels on the source site for mirroring in the CMS administrative interface.
  • Mirror channels – Start the mirroring process manually or automatically as a scheduled job in the CMS admin view.

Configure web.config

Change security credentials

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

<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
defaultProviderTo 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.
numberOfPagesinPackageIndicates the maximum number of pages in the package. Default: 500.
numberOfFilesInPackageIndicates the maximum number of files in the package. Default: 100.
destinationPathWhen CMS sends data among the machines, it stores temporary files in the destinationPath location.
chunkSizeThe chunk size of data sent between the machines. Default: 4194304 bytes. 
communication protocolWhen you install the mirroring application, it uses basicHttpBinding by default when communicating between the machines. To change this, change the bindings in the source and target application configuration files. See About WCF and Bindings on MSDN.
sourceConnectionStringNameBy default, the mirroring provider uses the connection string from the connectionStrings section. 
destinationConnectionStringNameBy default, the mirroring provider uses the connection string from the connectionStrings section. 
offlineLoggingEnabledIndicates whether offline logging is enable. Default is disabled (false); enable by setting to true.
offlineLogPathIndicates the path to the offline log. Default is *C:\Windows\Temp\episerver\cms6\mirroring\monitoring*. 
<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>

Change the mirroring application to a separate site

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

  1. Add site in IIS.

    Open IIS and delete the mirroring application under the source and target sites. After you delete the application, create a site and set its root folder to the Mirroring folder you created as a sub-folder to the source or 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" ... />

Configure the transfer provider act for the source and target provider

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

<connectionStrings>
        <add 
            name= "sourceDB" 
            connectionString="" />
        <add 
            name= "destinationDB" 
            connectionString="" />
    </connectionStrings>

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

Synchronize mirroring

Sync the bin folders 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 displays 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 application pool. When you add any custom code, property, or module under the source site, copy the affected assembly to the Mirroring Service bin folder. If you installed the mirroring service on both source and destination sites, the Site and Mirroring Service must have the same assemblies under the bin folders.