1

We have a UAT and LIVE Sitecore environment that hosts multiple websites and we use unicorn to sync data. The solutions uses Helix and for each project we have transforms for unicorn serialization config.

For our production CM environment, we have a synchronization transform that excludes content so during our Azure DevOps deployment to production, the unicorn sync step will not delete any live content but will add new data, components and settings.

The config below is our production CM serialization transform which excludes content

<?xml version="1.0" encoding="utf-8" ?>
<!-- For more information on using transformations 
     see the web.config examples at http://go.microsoft.com/fwlink/?LinkId=214134. -->
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <sitecore>
    <unicorn>
      <configurations>
        <configuration name="Project.Website" description="Website" dependencies="Foundation.*,Feature.*" extends="Helix.Project">
          <predicate>

            <include name="Project.Website.Content" database="master" path="/sitecore/content/Website" xdt:Transform="Replace" xdt:Locator="Match(name)">
              <exclude children="true">
                <except name="Site Settings/Datasources"></except>
              </exclude>
            </include>

            <include name="Project.Website.Media" xdt:Transform="Remove" xdt:Locator="Match(name)" />
            <include name="Project.Website.MoreMedia" xdt:Transform="Remove" xdt:Locator="Match(name)" />


          </predicate>
        </configuration>
      </configurations>
    </unicorn>
  </sitecore>
</configuration>

This is fine but over time, the live environment becomes out of sync with UAT and local development. What is the best approach to copy just new content including blobs from our production Master database to another environment?

1

To bring data down from the Production environment to UAT and local I would use Sitecore Sidekick Content Migrator.

This is a handy tool that you install in your instances and behind the scene's it uses Rainbow serialization to transfer items from one environment to another.

Content Migrator

Once you have it installed, you can set the config up so that each environment has a link to the production environment using the <servers> tag in the configuration file.

That will allow you to manually pull content from the live environment to another environment.

But - you can also schedule this task. This uses standard Sitecore scheduled tasks, and provides a way to regularly pull down the content from live to a UAT system. This is an example of the config you would set up - (When you install Sidekick, you get a sample of this too).

<scheduling>
    <agent description="production content to dev" type="ScsContentMigrator.ContentAgent, ScsContentMigrator" method="Run" interval="00:01:00">
        <param desc="remote server">[enter server url here i.e. https://sitecore-dev]</param>
        <param desc="id root">{0DE95AE4-41AB-4D01-9EB0-67441B7C2450},{3D6658D8-A0BF-4E75-B3E2-D050FABCF4E1}</param>
        <param desc="database">master</param>
        <param desc="bulk update">true</param>
        <param desc="children">true</param>
        <param desc="overwrite">true</param>
        <param desc="event disabler">true</param>
        <param desc="pull parent">true</param>
        <!-- make sure this is false if you would like to keep unique testing content intact-->
        <param desc="removeLocalNotInRemote">true</param>
    </agent>
</scheduling>

So with this inplace, you don't need to be pulling down the content manually if you don't want to.

There are other tools that will do similar functionality (RAZL) - but this would be my preferred way to do what you need.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.