November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
Product version: |
EPiServer CMS 5 R2 SP2 |
---|---|
Document version: |
1.0 |
Document last saved: |
This technical note contains a description of content mirroring and explains how to configure mirroring. The document also contains a test scenario and a detailed troubleshooting chapter.
The following is required to be able to configure mirroring correctly:
It is also a good idea that you have the following installed.
In EPiServer CMS 5, the information defining the content that should be mirrored from the Web site is defined in channels. You can have multiple channels defined in one EPiServer CMS site. Each channel contains properties that define the pages that should be included in a channel. A channel does not know or care about where the pages are being delivered, it only makes sure the underlying publisher receives information about the changes according to the channel properties.
Note It is important to understand that the channel mirrors what it can see, not the actual pages. This means that access rights, filters, publish dates, etc. can be used to obtain a customized view of data.
One of the major properties of a channel is the channel type. There are three types of channel to choose from:
New or modified content can be released either manually or automatically. This is defined in the channel properties. Content is manually released by the editor from the Action window.
The Mirroring service in Admin mode can be used to set up a scheduled job, so that content is automatically mirrored at, for example, a set time every day or week.
When changes are approved they are handed over to destinations as defined on the channel, these changes are queued in the database on each and every destination.
On the sender side, a "state" is kept that records which pages have been sent to a given destination. Whenever the mirroring job is run, the current site structure is extracted and then compared with the recorded "state" of the receiver site. This comparison leads to a number of operations being queued, such as a "publish", "move" and "delete". After the comparison and operations queuing, the recorded "state" of the receiver site is updated to reflect the updated situation.
The receiver side keeps a "mapping table", which records the mapping between the sender page IDs and the receiver site page IDs. So, when the receiver side receives a request from the sender to "publish", "move" or "delete" a page, it uses that sender page ID to look up the corresponding local page ID - mapping it in other words. This "mapping table" is built on-the-fly as mirroring requests are received by the Web service.
A "reset state" option is available on the sender side to clear the recorded "state", but this does not affect the receiver site. When resetting the state on the sender site, it is also a good idea to reset the receiver site at the same time. The best way to do this is currently to delete the pages in the receiver side and empty the Recycle Bin. This will ensure that the sender and receiver are in agreement. The "mapping table" will still be there, but all its targets have been deleted and it will thus clean itself up in the next mirroring.
Mirroring also picks up referenced files, and will begin a mirroring operation by sending these to the receiver using a Web service. Once that is completed, the actual page updates are sent. This will ensure that when pages are published, the relevant files will be there. It will also keep the size of each transfer down, since each file is sent separately.
The first time content is mirrored from the sender to the receiver, the mirroring should run without error as the receiver side has no current "states". When mirroring initially starts, the sender side sees that no content has been mirrored and will send all content regardless.
At the receiver end, there is no mapping table either, so the receiver will pick up the pages and effectively build an identical parallel tree. This might not be what you want, but it should not be a problem, as you can just switch the start page to the newly mirrored tree and remove the imported one at your leisure. The initial mirroring requires a full overwrite on the target.
Mirroring is not run as a single "transaction" and sender databases are not locked for read/write when a site is mirrored. There is a slight risk of short-term inconsistencies that will be resolved at the next mirroring operation, if editing is being done at the time of the mirroring, but there is no risk of long-term inconsistencies.
Example: Consider a "delete". Imagine that you start comparing the sender site with the recorded "state" of the receiver and find a page as unchanged there. After that an editor deletes the page. That change will not be detected by that mirroring operation. There are other more complex scenarios, but generally any inconsistencies will be fixed by the next run.
This chapter describes some typical scenarios for when mirroring may be used.
Mirroring to another EPiServer CMS 5 can be summarized as an automated export/import between two Web sites. When the content is changed, it is packaged into an export package in EPiServer CMS 5 and sent via a Web service to the other Web site, where it is unpacked and imported into the system.
There are, however, several differences between standard export/import in Admin mode.
Microsoft Web Service Extensions (WSE), which supports DIME, makes it more efficient to send binary files.
Mirroring to another EPiServer CMS 5 could perhaps be used if you want to have one development / test environment that is mirrored to an external environment.
EPiServer CMS 5 can mirror pages as HTML files by sending a Web request to the page's URL. This request downloads the content and stores it as HTML files in the local file system on the server. A tree structure in EPiServer CMS 5 will in this way be mirrored to a tree structure in the file system, where a page becomes a folder. The function will also search all HTML that is downloaded and search for references to images, links and style sheets.
Note: Links must be relative to the site for this to work; otherwise the links will be left untouched.
Note: Be aware that only resources referred to in EPiServer CMS 5 pages can be mirrored. For example, when mirroring a page that refers to a stylesheet, and this stylesheet in turn refers to an image, the stylesheet will be mirrored since the page referred to it, the image will not.
Mirroring to HTML takes longer than the other types of mirroring, as the Web server must be contacted for each page and the content downloaded. As changes to a single page can affect a large amount of pages, e.g. menus, there is a setting that controls that each update fetches all pages all over again and checks whether they are affected by the change.
XML mirroring works in a similar way to HTML mirroring in that each page will be mirrored as a file on the local file system. The only difference is that instead of downloading HTML from the page, the properties will be extracted and formatted to an XML document via an XML style sheet (XSLT).
Inserting a page is a very heavy operation in EPiServer CMS 5, so it is probably quite natural that the import takes as long as it does. This should not be an issue after the initial mirroring, as it is the insertion of pages that is heavy, and a typical mirroring operation is not at all comparable to importing/initially mirroring the whole site.
However, if you are still experiencing problems after the initial mirroring, it may be due to the fact that large objects (over 64k) are not always handled by the garbage collector of ASP.NET. Refer to the FAQ Performance issues and OutOfMemoryException.
Mirroring is not run as a single "transaction", so the sender database is not locked during mirroring. There is a slight risk of short-term inconsistencies that will be resolved at the next mirroring operation, if editing is being done at the time of the mirroring, but there is no risk of long-term inconsistencies.
If a visitor requests a page just as it is being updated by the mirroring receiver, the page the visitor sees will depend on the visitor's timing, i.e. either the new or the old page.
When exporting a file that is part of a page folder (or subfolder) all files in that folder (or subfolder) will be exported.
Make sure that you added the Web service extension in web.config on the destination server as described in the instructions above.
Make sure that you added the Web service extension in web.config on the destination server as described in the instructions above.
Make sure that the Web Service user has access to log on to the server. For more troubleshooting and configuration options, please refer to the “Web Services” technical note.
Maximum request length exceeded when exporting large amounts of information.
This problem is solved by changing certain settings in the system. Make sure that both httpRuntime and maxRequestLength are set in the receiving mirroring site. Change the maxRequestLength to 40960 KB (40 MB).
Example:
<httpRuntime maxRequestLength=”40960” />
<configuration>
…
<microsoft.web.services2>
<messaging>
<maxRequestLength>40960</maxRequestLength> //kilobyte
</messaging>
</microsoft.web.services2>
…
The following instructions show how to setup a destination and source site so that you can publish content from your source site to the destination site.
<authentication mode="Windows" />
<!--<authentication mode="Forms">
<forms name=".EPiServerLogin" loginUrl="Util/login.aspx" timeout="120" />
</authentication>-->
<authentication mode="Forms">
<forms name=".EPiServerLogin" loginUrl="/en/System/Users-and-profiles/Loginpage/" timeout="120" />
</authentication>
Make sure that you have followed the instructions in the previous chapter regarding configuration of content mirroring.
<!--
- XSLT is a template based language to transform Xml documents
It uses XPath to select specific nodes
for processing.
- A XSLT file is a well formed Xml document
-->
<!-- every StyleSheet starts with this tag -->
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<!-- indicates what our output type is going to be -->
<xsl:output method="xml" />
<!--
Main template to kick off processing our Sample.xml
From here on we use a simple XPath selection query to
get to our data.
-->
<xsl:template match="/">
<Page>
<Title><xsl:value-of select="/page/properties/property[@name='PageName']/text()"/></Title>
<Body><xsl:value-of select="/page/properties/property[@name='MainBody']/text()"/></Body>
</Page>
</xsl:template>
</xsl:stylesheet>
Field |
Description |
---|---|
Channel Name |
Lists all the channels that are available for the site. Click a channel name to display the Destination Overview window. |
Create (button) |
Click Create to create a new channel. This opens the Mirroring Settings window. |
This window is displayed when you create or edit a channel.
Field |
Description |
---|---|
Information tab |
|
Name |
Name of the channel. |
Start page |
Select a page from where you want to publish the structure. The page must contain pages or sub-folders. |
Mirror type |
Select the type of mirroring to be done. See the "Basic Concepts" chapter for further information on the different mirroring types. |
Globalization support |
Applies to globalized Web sites. Select whether you want to mirror the only the original language, all languages or another language. |
Approve changes automatically |
Select this check box if you want any changes to be approved automatically instead of approving them manually in the Action Window in Edit mode. Any changed pages will therefore be updated on the receiving site the next time the mirroring service is run. |
Include the start page |
Select this check box if you also want the changes to apply to the start page. |
Run as anonymous user |
Select this check box if you want to run the mirroring job as an anonymous user. If not, enter a username, password and domain. |
Property Filter tab |
|
Activate filter |
Select this check box if you want to activate the filter settings. |
Filter by property name |
Enter a property name, i.e. WriterName, to only mirror pages that include that property. |
Filter by property value |
Enter a property value for the stated property name. For example, if you enter property name WriterName and property value Charlie, only pages that include the value Charlie in the Writer field will be included in the mirrored site. |
This window displays an overview of the defined destinations for this channel
Field |
Description |
---|---|
Destinations |
Lists the destinations that have been created for the channel. |
Last status |
Displays the status of the most recent mirroring execution. |
Last execution |
Displays the date of the most recent mirroring execution. |
Queue length |
Displays how many jobs will be run the next time mirroring is executed. |
Edit Queue (button) |
Opens the Mirroring Queue for Destination window from where you can delete pages and packages that should not be included when mirroring the site. |
Mappings (button) |
Opens the Mirroring Mappings window from where you can delete individual mappings or all mappings. |
Settings (button) |
Opens the Mirroring Settings window. |
Reset State (button) |
Click Reset State on the sender side to clear the recorded "state". This will not affect the receiving site. |
This window varies depending on the destination of the mirrored site:
Field |
Description |
---|---|
Select destination type |
EPiServer |
Information tab |
|
Name |
Enter a name for the destination. |
Remote site |
Select a receiving site from the drop-down list. |
Root page on destination |
Enter the page ID of the root page on the receiving site. |
Publish pages |
Select this check box if you want to publish the pages automatically on the receiving site. If you leave this check box empty, the mirrored pages must be published manually on the receiving site. |
Queue tab |
This tab is only available if the changed pages to be mirrored have been approved. This tab is for information only. |
Queue number |
Lists the numbers of the queues to be included in the next mirroring execution. |
Item created |
Date when the pages to be mirrored were changed. |
Field |
Description |
---|---|
Select destination type |
HTML |
Information tab |
|
Name |
Enter a name for the destination. |
Target directory on the server |
Create a directory in your file system where you want the HTML pages to be published. Enter the name of the directory in this field, e.g. C:\episerverhtml. |
Relative root path |
Enter a prefix to be used for all the links. For example, enter "/episerverhtml/" in this field if you have selected C:\episerverhtml as the root directory and you are to run the remote site from your hard drive. |
Default name for files |
Change this value if you want your HTML files to have an alternative name as default. |
Use the following property for folder names |
This field defines the property name that control the name of the folder after mirroring to HTML. |
Verify check sum for all pages every time |
If this check box is selected, all the pages are downloaded every time a change is discovered on a page. One page can change many pages in listings, site maps, etc. Mirroring is speeded up if you do not need this function. |
Do not include file name in links |
Select this check box if you will be running the HTML site from a CD or hard drive and want to include the file name, e.g. Default.htm, in links. If you will be running the site online, it is usually preferable to only use the folder name for links and configure Default.htm as the default document in the Internet Information Services (IIS). |
Apply channel filter |
It is possible to require that certain properties apply to certain channels. Select this check box if you want to activate that listings and the menu tree are filtered in the same way when HTML is downloaded from a page. |
Queue tab |
This tab is only available if the changed pages to be mirrored have been approved. This tab is for information only. |
Queue number |
Lists the numbers of the queues to be included in the next mirroring execution. |
Item created |
Date when the pages to be mirrored were changed. |
Field |
Description |
---|---|
Select destination type |
XML |
Information tab |
|
Name |
Enter a name for the destination. |
Target directory on the server |
Create a directory in your file system where you want the XML pages to be published. Enter the name of the directory in this field, e.g. C:\episerverxml. |
Path to XSL template |
Create a file called template.xsl under your target directory. Fill the file with relevant text. (An example template.xsl can be found in this document.) Enter the path to your XSL file in the Path to XSL template field, e.g. C:\episerverxml\template.xsl. |
Relative root path |
Enter a prefix to be used for all the links. For example, enter "/episerverxml/" in this field if you have selected C:\episerverhtml as the root directory and you are to run the remote site from your hard drive. |
Default name for files |
Change this value if you want your HTML files to have an alternative name as default. |
Use the following property for folder names |
This field defines the property name that control the name of the folder after mirroring. |
Do not include file name in links |
Select this check box if you will be running the HTML site from a CD or hard drive and want to include the file name, e.g. Default.htm, in links. If you will be running the site online, it is usually preferable to only use the folder name for links and configure Default.htm as the default document in the Internet Information Services (IIS). |
Queue tab |
This tab is only available if the changed pages to be mirrored have been approved. This tab is for information only. |
Queue number |
Lists the numbers of the queues to be included in the next mirroring execution. |
Item created |
Date when the pages to be mirrored were changed. |