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.
Hope this helps.
Happy Sitecoring!