How to link Unicorn’s directories from solution and wwwroot?

If you use Unicorn to serialize your Sitecore’s items you probably at least once had to decide how to share a directory where serialized items are, between repository (solution) and your local Sitecore instance.

The most common solution is to store serialized items in the solution and just set the correct path to this directory in config files to let Sitecore instance read those.

Unfortunately, with this configuration, we need to adjust the path where items are, to every environment – who does like to remember about this?

If you do not want to do that, you can use “junction” which is just a different type of link. Thanks to the junction we can link the whole directory not a single file.

To create junction link you need to run following command from CMD:

mklink /J C:\inetpub\wwwroot\XXX\Data\Unicorn C:\Projects\XXX\App_Data\Unicorn

Where the first path is the place where your junction link will be created (wwwroot) and a second path is a place where your serialized items are (repository). That is it! So simple!

After the creation of a junction link, you will be able to use the same path on all environments!

Leave a Reply

avatar
  Subscribe  
Notify of