Automate Sitecore Content Synchronization using Sidekick PowerShell

  
Sitecore-Content-Sidekick-Powershell.png

I wanted to set up a daily Sitecore content synchronization to lower environments to ensure they are updated with the latest content from Production every morning.

The Sitecore Sidekick PowerShell module came to the rescue – Thank you Jeff Darchuk for the excellent module! One of its key advantages is that it eliminates the need to pass usernames or passwords for higher environments. 

https://github.com/JeffDarchuk/SitecoreSidekick?tab=readme-ov-file#scripting-sidekick

Installation:

Simply copy the Sidekick folder from the URL below and paste it into your PowerShell Modules on a Windows machine.

https://github.com/JeffDarchuk/SitecoreSidekick/tree/master/Scripting

Basically, it should reside in one of the paths found under $env:PSModulePath

Example: C:\Users\[USER]\Documents\WindowsPowerShell\Modules\SitecoreSidekick

P.S. I hope you have the Sidekick module installed, it needs a SharedSecret to communicate to the higher environments.

Content Sync:

After successfully installing the Sidekick PowerShell module, I created the following script to sync the Home page and its children from the Production environment to the QA environment.

 

Similarly, I created the following script for the Data folder on the SXA site, excluding the Sitewide Configuration item.

Scheduling:

With the scripts ready, I have scheduled both using Powershell Scripts Command to run every 12 hours to fetch items.

Sitecore-Sidekick-Content-Sync-Powershell.png

 

Sitecore-Sidekick-Content-Sync-Powershell-2.png

Hope this helps.

Happy Sitecoring!

Leave a Reply

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