Create a publishing target


Describes how to create a publishing target you can use for, for example, publishing a preview.

A publishing target consists of a database and a publishing target definition item that specifies that database. Sitecore publishes from the Master database to one or more publishing target databases. The Master database contains all versions of all data, including unapproved content changes.

The default publishing target, Internet, references the database named Web, but you can create additional publishing targets.

Reasons to create additional publishing targets include:

  • Geographic distribution: you can publish all content to multiple publishing targets on content delivery servers in multiple locations.

  • You want to publish to a preview publishing target before publishing to your live site.

To create a publishing target:

  1. Deploy a new database, for example by using the Web database from the installation package for your version of Sitecore.

  2. In the ConnectionStrings.config file on your CM server, add an entry similar to this:

    <add name="preview" connectionString="Data Source=.;Initial Catalog=web_preview;User ID=;Password=" />


    To use the database for content delivery instead of preview, add a connection on your CD server.

  3. Create a configuration patch file similar to this (the settings are in the Sitecore.config file):

    <?xml version="1.0" encoding="utf-8" ?>
     <configuration xmlns:patch="">
             <eventing defaultProvider="sitecore">
                    <eventQueue name="web_preview" patch:after="eventQueue[@name='web']" type="Sitecore.Data.Eventing.$(database)EventQueue, Sitecore.Kernel">
                         <param ref="dataApis/dataApi[@name='$(database)']" param1="$(name)" />
                         <param hint="" ref="PropertyStoreProvider/store[@name='$(name)']" />
                 <store name="web_preview" patch:after="store[@name='web']" prefix="web_secondary" getValueWithoutPrefix="true" singleInstance="true" type="Sitecore.Data.Properties.$(database)PropertyStore, Sitecore.Kernel">
                      <param ref="dataApis/dataApi[@name='$(database)']" param1="$(name)" />
                      <param resolve="true" type="Sitecore.Abstractions.BaseEventManager, Sitecore.Kernel" />
                      <param resolve="true" type="Sitecore.Abstractions.BaseCacheManager, Sitecore.Kernel" />
             <!-- web_secondary -->
                 <database id="web_preview" patch:after="database[@id='web']" singleInstance="true" type="Sitecore.Data.DefaultDatabase, Sitecore.Kernel">
                     <param desc="name">$(id)</param>
                     <dataProviders hint="list:AddDataProvider">
                         <dataProvider ref="dataProviders/main" param1="$(id)">
                             <prefetch hint="raw:AddPrefetch">
                                  <sc.include file="/App_Config/Prefetch/Common.config" />
                                  <sc.include file="/App_Config/Prefetch/Webdb.config" />
                    <PropertyStore ref="PropertyStoreProvider/store[@name='$(id)']" />
                            <obj ref="eventing/eventQueueProvider/eventQueue[@name='$(id)']" />
                        <archives hint="raw:AddArchive">
                            <archive name="archive" />
                            <archive name="recyclebin" />
                        <cacheSizes hint="setting">
  4. If you need a search index for the new database, copy the one for sitecore_web_index in the App_Config\Sitecore\ContentSearch\Sitecore.ContentSearch.Solr.Index.Web.config, and change it so that the crawler uses the new database. You must also change the index update strategy to get data from the new database.