Skip to content

Instantly share code, notes, and snippets.

@bic742
Created August 5, 2021 17:05
Show Gist options
  • Save bic742/8a72c914dc8f57fe26df504243565d28 to your computer and use it in GitHub Desktop.
Save bic742/8a72c914dc8f57fe26df504243565d28 to your computer and use it in GitHub Desktop.
Publishing Target Database Configuration
<?xml version="1.0" encoding="UTF-8"?>
<Settings>
<Sitecore>
<Publishing>
<Services>
<DefaultConnectionFactory>
<Options>
<Connections>
<!--This should be the name of the target in Sitecore -->
<Preview>
<Type>Sitecore.Framework.Publishing.Data.AdoNet.SqlDatabaseConnection, Sitecore.Framework.Publishing.Data</Type>
<LifeTime>Transient</LifeTime>
<Options>
<ConnectionString>${Sitecore:Publishing:ConnectionStrings:Preview}</ConnectionString>
<DefaultCommandTimeout>120</DefaultCommandTimeout>
<Behaviours>
<backend>sql-backend-default</backend>
<api>sql-api-default</api>
</Behaviours>
</Options>
</Preview>
<!-- This "PreviewResources" node is not specified in the documentation -->
<PreviewResources>
<Type>Sitecore.Framework.Publishing.Data.ResourceItems.ResourceConnection, Sitecore.Framework.Publishing.Data.ResourceItems</Type>
<LifeTime>Transient</LifeTime>
<Options>
<Path>items</Path>
</Options>
</PreviewResources>
</Connections>
</Options>
</DefaultConnectionFactory>
<StoreFactory>
<Options>
<Stores>
<Targets>
<Preview>
<Type>Sitecore.Framework.Publishing.Data.TargetStore, Sitecore.Framework.Publishing.Data</Type>
<!-- The documentation shows a different way for registering the connection name -->
<ConnectionNames>
<preview>Preview</preview>
<resources>PreviewResources</resources>
</ConnectionNames>
<FeaturesListName>TargetStoreFeatures</FeaturesListName>
<Id>579E92A7-B094-4F17-AF51-69F7214A3678</Id>
<ScDatabase>preview</ScDatabase>
</Preview>
</Targets>
</Stores>
</Options>
</StoreFactory>
</Services>
</Publishing>
</Sitecore>
</Settings>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment