Simple Sitecore Content Synchronisation with Sitecore Content Migrator

As a Sitecore developer you often find you need to keep Dev and Staging environments up-to-date with Production in order to aid in development and in support and maintenance – otherwise it is very hard to successfully develop and test new features or replicate an issue from Production locally.

This used to mean manually backing up and restoring databases or creating Sitecore Packages to pull content down. This process is a labour intensive and error prone as well as a pretty daunting task :-(.

Sitecore Content Migrator to the rescue

migratorThankfully Jeff Darchuk created Sitecore Content Migrator back in October to do just this for you.

Sitecore Content Migrator is a free tool for Sitecore Sidekick which allows you to quickly and easily sync content down from one environment to another. It’s pretty simple to install and setup and then can be used whenever you want to carry out a sync.

It uses the same underlying technology as Unicorn (Rainbow), is pretty rapid and gives you some nice updates on progress along with a preview feature – so you can check all the changes before you run the import for real.

Installing & Configuring Sitecore Content Migrator

  1. First you need to install Sidekick itself. You can do this with the Sidekick Sitecore Module using the Sitecore package installer (https://marketplace.sitecore.net/en/Modules/S/Sitecore_Sidekick.aspx) or instead use NuGet to install it like so from Vistual Studios Package Manager Console:

    Install-Package SitecoreSidekickCore -Version 1.0.0.

    Ensure you install this on all environments you wish to pull content from as well as the environments where you will use it. This is because the service used by the Content Migrator must also exist remotely.

  2. Once you have installed the module you should find it has also installed 4 new config patch files (zSCS.config, zSCS.Aduitlog.config, zSCS.ContentMigrator.config, zSCS.Editingcontext.config). The one you want to edit is zSCSContentMigrator.config.
    Alter the servers list to include the environments you want to pull content from, in our case Production and Staging:

    <servers hint=”raw:BuildServerList”>
    <server>https://production.yoursite.com</server>
    <server>https://staging.yoursite.com</server>
    </servers>

Time to Sync

  1. Go to an environment where you want to sync content to. Click on the Start button and open Sitecore Sidekick. Then click on ‘Content Migrator’:
    sidekick-dashboard
  2. Select the server to pull content from (e.g ‘production.yoursite.com’), then browse the content node and select the content you wish to sync.
  3. Then check any of the following options to sync all content down and update the local site:
    –  ‘Migrate all children of selected item’
    –  ‘Overwrite all existing content with new content from the server’
    –  ‘If parent doesn’t exist locally add that too’
    –  ‘Make local content tree mirror the remote content tree’ Note: Jeff confirmed to me on Slack that this maintains the existing Sitecore IDs. So this is great if you use Unicorn and don’t want to mess up Dev content IDs.
    –  ‘Run using the event disabler’
    –  ‘Run using the bulk update context’
    Further information on these options and what they do can be found here: Sitecore Content Migrator
    content-migrator-step0

  4. Click the ‘Preview’ button
  5. Check that everything looks ok
  6. Click the ‘execute this operation’ button.
  7. Monitor the import and check that it completes successfully – look under the ‘Currently Running Operations’ section.
  8. Publish the site
  9. Test the site works as expected in your environment
  10. Rejoice as not having had to do much

Suggested Improvements

  • It would be really good to support automated scheduled syncs either by setting this up in config or saving an migration config. – I’ve already suggested this to Jeff and he’s logged it as a feature request.
  • It would also be cool to be able to sync multiple root nodes, e.g content and media library items at once.

All in all this is a great tool for making content syncs a whole lot simpler and allowing you to concentrate on development instead of manually keeping your environments in sync.

Published by

Adam Seabridge

I am a Freelance Sitecore Developer and 7x Sitecore Technology MVP (2024 - 2018). I have been working with Sitecore since 2013. You can reach me on twitter @billyjava or comment below if you have any questions or feedback.

8 thoughts on “Simple Sitecore Content Synchronisation with Sitecore Content Migrator”

  1. Nice article !
    I have following question –
    My CM server does not have default sitecore password.
    Do i need to do any separate changes for this updated password, or will it work just by giving CM server url in server tag ?

    1. Yes the list is just the CM servers as it Syncs to the Master database, you can then review and publish the content as required to your CD Servers. It does not automatically publish to the CD Servers.

  2. I has question on the ”: Is this the list of CM servers only and not the CD servers?
    Also does the ‘Pull’ function pull the content into master only and I have to manually publish into CD/s or does it to that automatically?

  3. I has question on the raw:BuildServerList: Is this the list of CM servers only and not the CD servers?
    Also does the ‘Pull’ function pull the content into master only and I have to manually publish into CD/s or does it to that automatically?

    1. Please see my reply above. It is just the CM Servers. Regarding Auto-publishing this is not support as far as I’m aware, I did ask Jeff about this a while ago but I don’t think he’s built in support for it yet. What I have done before though is use Sitecron to auto-publish specific items at a certain time each day: https://www.akshaysura.com/2015/06/25/smart-and-incremental-publish-using-sitecron-for-sitecore/. I presented at the Manchester SUG about this and you can find my slides here: https://www.slideshare.net/AdamSeabridge/automating-content-syncs-using-content-migrator/AdamSeabridge/automating-content-syncs-using-content-migrato. You could do this after the auto-sync job has run (this is supported out of the box) or you could also use the SPE module to auto-run the sync of content before the Sitecron Job runs instead of using the auto-sync job: https://github.com/JeffDarchuk/SitecoreSidekick/tree/master/Scripting.

Leave a Reply to fluxadmin Cancel reply

Your email address will not be published. Required fields are marked *