HomeDev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunitySubmit a ticketLog In
GitHubNuGetDev CommunitySubmit a ticket

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 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 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 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. 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.

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 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.

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 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.

<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 max number of pages in package. Default: 500.
numberOfFilesInPackageIndicates the max number of files in package. Default: 100.
destinationPathWhen data is sent between the machines, temporary files are stored in the destinationPath location.
chunkSizeThe chunk size of data sent between the machines. Default: 4194304 bytes. 
communication protocolWhen 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.
sourceConnectionStringNameThe mirroring provider uses the connection string from the connectionStrings section, by default. 
destinationConnectionStringNameThe mirroring provider uses the connection string from the connectionStrings section, by default. 
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 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" ... />

Configure 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.

<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

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.