1

I am not sure on which databases the Sitecore Items are synced to when I deploy my Sitecore solution to the CM system with the Sync.ps1 script and the Unicorn.psm1. I think the items are also synced to my Web Database, what I want to prevent. So that items are only created in Master and Core Database when I am Syncing items.

I've seen this in the Unicorn.AutoPublish.config

<unicornSyncEnd>
    <processor type="Unicorn.Pipelines.UnicornSyncEnd.TriggerAutoPublishSyncedItems, Unicorn">
        <PublishTriggerItemId>/sitecore/templates/Common/Folder</PublishTriggerItemId> 
        <TargetDatabases hint="list:AddTargetDatabase">
            <web>web</web>
        </TargetDatabases>
    </processor>
</unicornSyncEnd>

Can I remove the web here? Or has this nothing to do where the Items are Synced to?

I only want new items and templates get to the web Database when I publish my content.

3
  • 4
    It would be highly irregular to configure Unicorn to sync directly to "web" - even if it is possible in theory. You need to disable your AutoPublish.config to disable the publish that happens at the end - as you point out. You should not edit the file however.
    – Mark Cassidy
    Jun 29 '21 at 13:02
  • @MarkCassidy so it would be enough to just set the required role to Standalone for the file content right? Jun 29 '21 at 13:26
  • Normally, yes. Your upstream CM server would traditionally be in the "ContentManagement" role. But locally I don't see why you would need publishing either - local environments are usually configured in live-mode.
    – Mark Cassidy
    Jun 29 '21 at 13:27
1

It is recommened for higher environments to disable the unicorn autopublish, however you shouldn't edit the file directly as in future upgrades it might be required to update/overwrite it. One option would be to handle it in the deploy pipeline using a config transform for example Unicorn.AutoPublish.transform.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/" xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <sitecore role:require="Standalone or ContentManagement">
    <pipelines>
      <unicornSyncEnd>
        <processor>
          <TargetDatabases hint="list:AddTargetDatabase" xdt:Transform="Replace" />
        </processor>
      </unicornSyncEnd>
    </pipelines>
  </sitecore>
</configuration>

This will just remove the web database which is the first check in the TriggerAutoPublishSyncedItems processor: https://github.com/SitecoreUnicorn/Unicorn/blob/master/src/Unicorn/Pipelines/UnicornSyncEnd/TriggerAutoPublishSyncedItems.cs

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.