Sitecore Razl allows the user to to create XML documents that define connections to Sitecore servers and the operations Sitecore Razl should perform on those servers. These can then be executed from the Command Prompt or build scripts.
The command line parameters Sitecore Razl accepts from the command line are as follows:
To run a Sitecore Razl script with TLS 1.2 enabled, use a command similar to:
Razl.exe /script:Migrate.xml /TLS12:true
A Sitecore Razl script can be run from the command line with the following parameter:
Razl.exe /script:"{path to script file}"
The value {path to script file} should be replaced with the path to the XML file that contains the Sitecore Razl script to run, for example:
Razl.exe /script:Migrate.xml
Razl.exe /script:"c:\Site Migration\Razl.xml"
The XML for Sitecore Razl scripts is very simple and is made up of connections and operations, by combining connections with operations Sitecore Razl will perform tasks on the intended Sitecore instances. Below is an overview of the entire Sitecore Razl XML:
<razl>
<connection name="" readOnly ="" install="true|false">
<url></url>
<accessGuid></accessGuid>
<database></database>
<path></path>
<readThreads></readThreads>
<writeThreads></writeThreads>
</connection>
<connection name="">
<url></url>
<guid></guid>
<database></database>
<readThreads></readThreads>
<writeThreads></writeThreads>
</connection>
<connection name="" preset="" />
<operation name="CopyHistory" source="" target="">
<parameter name="from">[date|integer days]</parameter>
<parameter name="to">[date|integer days]</parameter>
<parameter name="recycle">true|false</parameter>
<parameter name="lightningMode">true|false</parameter>
<parameter name="include">
<value></value>
</parameter>
<parameter name="exclude">
<value></value>
</parameter>
</operation>
<operation name="CopyAll" source="" target="">
<parameter name="itemId"></parameter>
<parameter name="overwrite">true|false</parameter>
<parameter name="lightningMode">true|false</parameter>
<parameter name="continueOnError">true|false</parameter>
</operation>
<operation name="CopyItem" source="" target="">
<parameter name="itemId"></parameter>
</operation>
<operation name="CopyVersion" source="" target="">
<parameter name="itemId"></parameter>
<parameter name="languageId"></parameter>
<parameter name="versionNum">number or [blank]</parameter>
<parameter name="folderType">shared, unversioned or [blank]</parameter>
<parameter name="removeVersion">true|false</parameter>
</operation>
<operation name="DeleteItem" source="" target="">
<parameter name="itemId"></parameter>
<parameter name="recycle">true|false</parameter>
</operation>
<operation name="MoveItem" source="" target="">
<parameter name="itemId"></parameter>
<parameter name="newItemPath"></parameter>
<parameter name="newParentId"></parameter>
</operation>
<operation name="SetFieldValue" source="" target="">
<parameter name="itemId"></parameter>
<parameter name="fieldId"></parameter>
<parameter name="fieldName"></parameter>
<parameter name="fieldValue"></parameter>
<parameter name="languageId"></parameter>
<parameter name="versionNum"></parameter>
</operation>
<operation name="SetPropertyValue" source="Sitecore7.local.master" target="Sitecore7.Local.Web">
<parameter name="itemId"></parameter>
<parameter name="propertyName">Template Id</parameter>
<parameter name="propertyValue"></parameter>
</operation>
</razl>
Connections define how Sitecore Razl should connect to a Sitecore instance. Connections can be fully defined in the XML or can be preset connections that have been defined in the Sitecore Razl GUI. The connection XML with all options looks like this:
<connection name="" readOnly="" install="true|false" preset="">
<url></url>
<accessGuid></accessGuid>
<database></database>
<path></path>
<readThreads></readThreads>
<writeThreads></writeThreads>
</connection>
Summary of attributes and elements:
At least two connections should be defined in a Sitecore Razl script.
A defined connection is a connection that has the URL, AccessGuid and Database and name defined in the XML. The minimum XML required is:
<connection name="">
<url></url>
<accessGuid></accessGuid>
<database></database>
</connection>
Using a defined connection it is possible to install the Sitecore Razl service required by Sitecore Razl to communicate with Sitecore. The additional attribute install and the path element a required for this to work:
<connection name="" install="true">
<url></url>
<accessGuid></accessGuid>
<database></database>
<path></path>
</connection>
A connection can also be made read only by adding the readOnly attribute:
<connection name="" readOnly="true">
<url></url>
<accessGuid></accessGuid>
<database></database>
</connection>
Preset connections are connections that have been defined in the Sitecore Razl GUI first. The XML for a preset connection is:
<connection name="" preset="" />
The value for the preset connection should be save value shown in the Sitecore Razl Connections dropdown. For example if in the Sitecore Razl GUI the following connections are defined:
The configuration to use the Awesome connection would be:
<connection name="" preset="Awesome" />
Preset connections can not be made read only from the XML or be installed by the XML, these tasks should be performed in the Sitecore Razl GUI.
Operations define the actions that Sitecore Razl should perform. The basic XML structure for an operation is:
Summary of attributes and elements:
An operation can have 0 or more child parameters. Parameters have the following basic XML structures:
Or
Summary of attributes and elements:
If a parameters contains a single value it is possible to define the parameter without a value element, e.g:
<parameter name="example">a value</parameter>
If the parameters required multiple values these can be defined using the value child element:
<parameter name="example">
<value>a value 1</value>
<value>a value 2</value>
</parameter>
The CopyHistory operation will replay the actions recorded in the Sitecore history engine on one instance on another instance. The full XML for the CopyHistory operation is:
<operation name="CopyHistory" source="" target="">
<parameter name="from"></parameter>
<parameter name="to"></parameter>
<parameter name="recycle">true|false</parameter>
<parameter name="lightningMode">true|false</parameter>
<parameter name="include">
<value></value>
</parameter>
<parameter name="exclude">
<value></value>
</parameter>
</operation>
Summary of parameters:
The CopyItem operation will copy an item from the source Sitecore instance to the target Sitecore instance. The full XML for the CopyItem operation is:
<operation name="CopyItem" source="" target="">
<parameter name="itemId"></parameter>
</operation>
Summary of parameters:
The CopyAll operation will copy an item from the source Sitecore instance to the target Sitecore instance and all child items. The full XML for the CopyAll operation is:
<operation name="CopyAll" source="" target="">
<parameter name="itemId"></parameter>
<parameter name="overwrite">true|false</parameter>
<parameter name="lightningMode">true|false</parameter>
</operation>
Summary of parameters:
Sitecore Razl Script mode will output actions as they happen to the command prompt, this output can be piped to a text file if required.
If a log folder has been set in the Sitecore Razl GUI then Script mode will also write to the log folder.