Nowadays most of the Sitecore projects use various tools for the Item Synchronization to sync all the Items of the project between the team members. In most cases TDS is used for the serving this purpose but only disadvantage it have is the paid license for each developer. But now we have the open-source alternate for this as well known as Unicorn.
Unicorn provide the efficient way to serialize all the Items. In this guide I’ll showcase how Unicorn can be setup for the Sitecore Project.
Step 1: Installing the Unicorn
I’m using Helix based solution for the setting up the unicorn for Sitecore 9.
- First Create a project in Foundation with name [ProjectName].Foundation.Serialization. This is where we will install the Unicorn.
- Right click on the project Go to Manage Nuget Package > Search for the Unicorn. Install the Unicorn.
- After installing the Unicorn Serialization project will look like this.
- Build and Publish your solution. You can verify the installation by browsing to http:://[yourinstance]/unicorn.aspx.
Step 2: Configuring Unicorn Sync Items
If we are setting up the Unicorn on the Helix base solution best practice is to sync the Item related to feature in the separate folder and all the upper layer in the Serialization folder itself. For setting up the serialization we need to create a configuration like below:
In this file, targetDataStore point to the physical location for the yml files. Predicate node is the most important node of this configuration files where we specify the path which we want to sync using the unicorn.
After publishing the Serialization project with this configuration your Unicorn.aspx will look like below screen.
Now you can sync your items using the Unicorn. Cheers!!!.