Try our conversational search powered by Generative AI!

Loading...
Area: Optimizely CMS
ARCHIVED This content is retired and no longer maintained. See the latest version here.

Recommended reading 

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

Mirroring can only be installed for CMS 7.5 (through Deployment Center). To use mirroring with the latest EPiServer version, install a CMS 7.5 site with mirroring, and then upgrade to the latest through NuGet. There is no NuGet package available for the content mirroring functionality (it is installed as a separate service in a virtual directory on the server).

Introduction

A mirroring job is normally done between two sites. This means that two sites probably have to be installed, one as a source site and one as a target site. Each site can be used 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 on the machine. This has to be done to be able to install Mirroring. Alternatively, EPiServerShared.msi and EPiServerCMS.msi can be run instead of the setup file.

Installing mirroring on a new website

Install mirroring on a new website as follows:

  1. Open 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 or not.
    The mirroring part of the site will be installed as an application under the site/application with a separate application pool. This can be changed 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 any 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 will pop up a window where you need to select the credentials that will be used when a Mirroring job is run. These settings will be editable from the mirroring configuration file web.config.
    - Enter the username of a user that will do the export and import of pages and files when the mirroring job is run.
    - Enter the password of the user that will do the export and import of pages and files when the mirroring job is run.
    - The domain the user belongs to that will do the export and import of pages and files when the mirroring job is run.

Installing mirroring on an existing website

To be able 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).

Install mirroring on an existing website as follows:

  1. Open EPiServer Deployment Center, and select Install Mirroring to start the installation.
  2. Choose site. Choose which site you want to install the Mirroring application on. Note that only sites installed on port 80 will be visible and selectable.
  3. Credentials. At the end of the installation, the Mirroring module will pop up a window where you need to select the credentials that will be used when a Mirroring job is run. These settings will be editable from the mirroring configuration file (web.config).
    - Enter the username of a user that will do the export and import of pages and files when the mirroring job is run.
    - Enter the password of the user that will do the export and import of pages and files when the mirroring job is run.
    - The domain the user belongs to that will do the export and import of pages and files when the mirroring job is run.
  4. Summary. Displays the settings. Check all the settings before continuing with the installation.

Configuring the target site

Creating a target page

Create a page that will act as the root page for the mirrored pages on the target site in the EPiServer CMS editorial interface. It is also possible to 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 the web.config file

Changing Security Credentials

To change the security credentials that are used when a Mirroring job is run, open the web.config file 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
Changing chunk size By default, the chunk size of the data sent between the machines is set to 4194304 bytes. This can be changed by changing this value in the provider attributes.
Changing temporary folder When data is sent between the machines, temporary files are stored in a location that can be modified in the configuration file. In the MirroringTransferServer provider, there is an attribute called “destination path” where you can set the temporary path.
Changing numberOfPagesinPackage By default the numberOfPagesInPackage is 500. Indicates the max number of pages in package.
Changing numberOfFilesInpackage By default the numberOfFilesInPackage is 100. Indicates the max number of files in package.
Changing communication protocol When the mirroring application is installed, basicHttpBinding will be used 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.
Changing offlineLoggingEnabled and offlineLogPath By default offline monitoring is disabled and can be enabled by setting the offlineLoggningEnabled to true.
By default the path to offline monitoring log is "C:\Windows\Temp\episerver\cms6\mirroring\monitoring\" and it can be changed to another path by setting the offlineLogPath attribute.
Source Connection String By default the mirroring provider uses the connection string which is defined in the connectionStrings section. But you can change it by defining the sourceConnectionStringName attribute on the provider setting.
Destination Connection String By default the mirroring provider uses the connection string which is defined in the connectionStrings section. But you can change it by defining the destinationConnectionStringName attribute on the provider setting. This settings is useful when the mirroring provider take care both source and destination
Using another mirroring provider It is possible to use other mirroring providers than the built-in provider. Add the provider in the episerverMirroring section and set the defaultProvider to the provider you want to run.
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

When the Mirroring application is installed by the Deployment Center, it is installed as an application under the EPiServer CMS site chosen. To change the mirroring application to a separate site, you need to do the following:

  1. Add site in IIS. Open up IIS and delete the Mirroring application under the source and target sites. After the application has been 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. This document does not contain any 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 for both the source and target mirroring sites. The addresses for both mirroringSourceEndpoint and mirroringTransferEndpoint must be updated so it points 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

By defining sourceConnectionStringName and destinationConnectionStringName attributes on the provider setting 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

You need to synchronize the bin folders both under Site root folder and Mirroring Service bin folder. When assemblies in the site bin folder and mirroring service bin folder are not same, you will receive the following error when performing “Check System”:

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

It is important to have both bin folders synchronized with each other, since the Mirroring Service runs as a separate application and is having its own application pool. When you add any custom code/property/module under the source site, the affected assembly should be copied over to the Mirroring Service bin folder as well. If you have installed mirroring service on both source and destination sites, then Site and Mirroring Service must have the same assemblies under the bin folders.

See also

Do you find this information helpful? Please log in to provide feedback.

Last updated: Feb 23, 2015

Recommended reading