Deploy Coveo for Sitecore on the Content Delivery Servers

The instructions below presume that you have a setup similar to the one in the Setting up the Sitecore Infrastructure article (see Sitecore Infrastructure Setup).

If your environment is different, read the steps carefully since you will need to tailor some of them to your environment.

Step 1: Copying the Package to CDs

The Coveo for Sitecore installation package contains several files that are added to the Sitecore website directory.

  1. Locate the installation package you used for the content manager (see Releases and Downloads).

  2. Unzip the Coveo for Sitecore XX <BUILD_NUMBER>.zip.

  3. Open the package.zip file.

  4. Copy the contents of the files folder to the appropriate folders on each CD. The files folder mimics the folder structure found in the Sitecore website.

    Sitecore 7 and 8 Copy the contents of the files folder into the corresponding folders under <SITECORE_INSTANCE_ROOT>\Website\ on each CD.

    Sitecore 9 and 10 Copy the contents of the files folder into the corresponding folders under Local Disk\inetpub\wwwroot\<SITECORE_INSTANCE> on each CD.

For Azure Web App deployments, consider using a tool like the Kudo console for file and folder manipulations (e.g., browsing, uploading/downloading, copying, editing, renaming, deleting).

Refer to this Microsoft blog article for more tips on tools designed for working with files in Azure.

Copying Coveo for Sitecore SXA files to CDs

If you’re using SXA, copy the Coveo for Sitecore SXA package files to your CDs the same way you did above.

  1. Locate the installation package you used for the content manager (see Releases and Downloads).

  2. Unzip the appropriate Coveo for Sitecore SXA <SXA_VERSION(s)> <BUILD_NUMBER>.zip file, based on the version of Sitecore you’re using.

  3. Open the package.zip file.

  4. Copy the contents of the files folder to the appropriate folders on each CD. The files folder mimics the folder structure found in the Sitecore website.

    Sitecore 7 and 8 Copy the contents of the files folder into the corresponding folders under <SITECORE_INSTANCE_ROOT>\Website\ on each CD.

    Sitecore 9 and 10 Copy the contents of the files folder into the corresponding folders under Local Disk\inetpub\wwwroot\<SITECORE_INSTANCE> on each CD.

Step 2: Ensuring Access to the Encryption Keys

Coveo for Sitecore (May 2019)

Coveo for Sitecore stores the encryption keys in the Properties table of the core database. These keys must be the same on all the Sitecore instances to be able to decrypt the encrypted configuration elements.

If your CMs and CDs don’t share the same core database, make sure you have a database replication strategy in place.

Coveo for Sitecore (May 2019)

Coveo for Sitecore stores the encryption keys in the Properties table of the core database (for Sitecore versions up to 9.0 inclusively) or the web database (for Sitecore versions 9.1 onwards). These encryption keys must be the same on all the Sitecore instances to be able to decrypt the encrypted configuration elements.

If your CMs and CDs don’t share the same core/web database, make sure you have a database replication strategy in place.

Step 3: Copying the Configuration Files

Since the index is shared between all the Sitecore instances, you need to configure all the additional Sitecore instances (CMs and CDs) to use the same base configuration as the CM1 Sitecore instance.

  1. Delete the Coveo configuration files folder(s) in each additional Sitecore instance.

    Sitecore 7 and 8 In each additional Sitecore instance, delete the Coveo folder located in the <SITECORE_INSTANCE_ROOT>\Website\App_Config\Include\ folder.

    Sitecore 9 and 10 In each additional Sitecore instance, delete the Coveo folders located in the <SITECORE_INSTANCE_ROOT>\App_Config\Include\ and <SITECORE_INSTANCE_ROOT>\App_Config\Modules\ folders.

  2. Copy the configuration files folder(s) of the CM1 instance to each additional Sitecore instance.

    Sitecore 7 and 8 Copy the Coveo folder located in the <SITECORE_INSTANCE_ROOT>\Website\App_Config\Include\ folder of your CM1 instance. Paste it into your <SITECORE_INSTANCE_ROOT>\Website\App_Config\Include\ folder of your other instances.

    Sitecore 9 and 10 Copy the Coveo base configuration files folder located in the <SITECORE_INSTANCE_ROOT>\App_Config\Modules\ folder of your CM1 instance. Paste it into the <SITECORE_INSTANCE_ROOT>\App_Config\Modules\ folder of your other instances.

    Sitecore 9 and 10 Copy the Coveo custom configuration files folder located in the <SITECORE_INSTANCE_ROOT>\App_Config\Include\ folder of your CM1 instance. Paste it into the <SITECORE_INSTANCE_ROOT>\App_Config\Include\ folder of your other instances.

Step 4: Enabling SwitchMasterToWeb

Sitecore 7 and 8

Sitecore provides a file named SwitchMasterToWeb.config.example.

  • For Sitecore 7.x, this file must be downloaded from the Sitecore web site (see Sitecore Scaling Guide).

  • For Sitecore 8.0, the file is located in the App_Config\Include folder.

  • For Sitecore 8.1+, the file is located in the App_Config\Include\Z.SwitchMasterToWeb folder.

Coveo provides a SwitchMasterToWeb.Coveo.config.example located in the App_Config\Include\Coveo folder.

Both files should be enabled. To ensure that all indexes are disabled correctly, we recommend that you move SwitchMasterToWeb.config.example and SwitchMasterToWeb.Coveo.config.example to the subfolder named Z.SwitchMasterToWeb. For Sitecore versions prior to 8.1, you should create the folder.

Sitecore first parses .config files in alphabetical order and then processes all subfolders and their content in alphabetical order. Prefixing the subfolder name with Z ensures that the .config files it contains are processed at the very end, and consequently disables search indexes defined in all previously parsed .config files.

  1. Enable the Sitecore SwitchMasterToWeb.config.example file by removing the .example extension.

  2. Enable the Coveo SwitchMasterToWeb.Coveo.config.example file by removing the .example extension.

  3. The Sitecore Scaling Guide suggests adding a pub database, as illustrated in Sitecore Infrastructure Setup. You should apply the following patches only if you use a different database than web for your CD servers.

    1. Open the SwitchMasterToWeb.Coveo.config file and apply the following changes:

      The CD servers shouldn’t be used to perform indexing tasks. All <strategy> elements must be removed from the <index> definition.

       <indexes>
         <index id="Coveo_master_index">
           <patch:delete />
         </index>
         <index id="Coveo_web_index">
           <patch:delete />
         </index>
         <index id="Coveo_pub_index">
           <strategies>
             <patch:delete />
           </strategies>
         </index>
       </indexes>
      
    2. By default, Coveo for Sitecore creates sites using the web database, which will cause an error in the current setup. To change the sites, create a <sites> section and patch the references to use the pub database:

       <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
         <sitecore>
           ...
           <sites>
             <site name="coveorest">
               <patch:attribute name="database">pub</patch:attribute>
             </site>
             <site name="coveoanalytics">
               <patch:attribute name="database">pub</patch:attribute>
             </site>
             <site name="coveo_website">
               <patch:attribute name="database">pub</patch:attribute>
             </site>
             <site name="website">
               <patch:attribute name="database">pub</patch:attribute>
             </site>
           </sites>
         </sitecore>
       </configuration>
      
  4. Open the Coveo.SearchProvider.Custom.config file in a text editor. The Coveo.SearchProvider.Custom.config file is located in the <SITECORE_INSTANCE_ROOT>\Website\App_Config\Include\Coveo folder.

  5. We recommend you skip the Sitecore login validation and credentials update, to simplify the deployment. Add the following section in the defaultIndexConfiguration element:

    <defaultIndexConfiguration>
      ...
      <securityConfiguration type="Coveo.Framework.Configuration.SecurityConfiguration, Coveo.Framework">
        <skipSitecoreCredentialsUpdate>true</skipSitecoreCredentialsUpdate>
        <skipSitecoreLoginCheck>true</skipSitecoreLoginCheck>
      </securityConfiguration>
    </defaultIndexConfiguration>
    
  6. Save and close the files.

Step 5: Preventing CDs From Trying to Write to the Property Store Database

In certain circumstances, Coveo for Sitecore may try to write LASTCRITICALINDEXINGEXCEPTION records to the Property Store. This will cause errors if you have set the Property Store database to read-only mode. To prevent these errors, you can set the Coveo for Sitecore CriticalExceptionsDisabled setting to true. The way to do this depends on the Sitecore version you have.

Sitecore 7 and 8

  1. In the SwitchMasterToWeb.Coveo.config file, in the <settings> element, add the following <setting> child element:

    <setting name="Coveo.Framework.CriticalExceptionsDisabled" value="true" />
    
  2. Save your changes.

Sitecore 9 and 10

  1. In the <SITECORE_INSTANCE_ROOT>\App_Config\Include\Coveo\Coveo.SearchProvider.Custom.config file, try to locate the <settings> element, a child of the <sitecore> element. If the <settings> element is missing, add it.

    ...
      <sitecore coveo:require="!disabled">
        <settings>
        </settings>
    ...
    
  2. In the <settings> element, add the following <setting> child element:

    <setting role:require="ContentDelivery" name="Coveo.Framework.CriticalExceptionsDisabled" value="true" />
    
  3. Save your changes.

What’s Next?

You’re now done with deploying Coveo for Sitecore, and you should test your connection to make sure everything is working (see Validate Connectivity of the New Hosts).

Recommended Articles