Sitecore XP support for MongoDB 4.0


Description

MongoDB 3.6 reaches the end of life support in April 2021 (as stated here). To provide continuing support for our customers, the following versions of Sitecore XP have been tested and certified to work with MongoDB 4.0.5 and 4.0.13: Customers using Sitecore XP 9.1.1 or earlier must upgrade to MongoDB version 4.0 or later.

Prerequisites

  1. Download the MongoDb4Sitecore.zip file.
  2. Unzip the files to a local folder.

Update Instructions For XP 8.2

Note that the following instructions are only valid for Sitecore XP 8.2.7. Customers running any previous versions must update the instance to Sitecore XP 8.2.7 or later.
  1. In the wwwroot\Website\Bin catalog, replace the following Mongo .dll files with the same ones with version 2.8.
    • From the CSharpDriver-2.8.0\net452 folder:
      • MongoDB.Bson.dll
      • MongoDB.Driver.Core.dll
      • MongoDB.Driver.dll
      • MongoDB.Driver.Legacy.dll
    • From AdditionalLibraries:
      • System.Runtime.InteropServices.RuntimeInformation with the same with version 4.0.1.0
  2. Add dll-files from AdditionalLibraries to wwwroot\Website\Bin:
    • DnsClient, Version=1.3.1.1
    • System.Buffers, Version=4.4.0.03
  3. Add the following lines to the web.config  assemblyBinding section: 
    <dependentAssembly>
    <assemblyIdentity name="MongoDB.Bson"/>
    <bindingRedirect newVersion="2.8.0.0" oldVersion="0.0.0.0-2.4.4.0"/>
    </dependentAssembly>
    <dependentAssembly>
    <assemblyIdentity name="MongoDB.Driver"/>
    <bindingRedirect newVersion="2.8.0.0" oldVersion="0.0.0.0-2.4.4.0"/>
    </dependentAssembly>
    <dependentAssembly>
    <assemblyIdentity name="MongoDB.Driver.Core"/>
    <bindingRedirect newVersion="2.8.0.0" oldVersion="0.0.0.0-2.4.4.0"/>
    </dependentAssembly>
    <dependentAssembly>
    <assemblyIdentity name="MongoDB.Driver.Legacy"/>
    <bindingRedirect newVersion="2.8.0.0" oldVersion="0.0.0.0-2.4.4.0"/>
    </dependentAssembly>
    <dependentAssembly>
    <assemblyIdentity name="system.runtime.interopservices.runtimeinformation" publicKeyToken="b03f5f7f11d50a3a"/>
    <bindingRedirect newVersion="4.3.0" oldVersion="0.0.0.0-4.0.1.0"/>
        </dependentAssembly>
  4. Re-check that port numbers in ..\wwwroot\Website\App_Config\ConnectionStrings.config are equal to MongoDB server 4.0.
  5. Repeat steps 2 - 4 for all roles and/or instances.

Update Instructions For Collection Database For XP 9.0.2-9.1.1

The following instructions are applicable to
Copy and Overwrite all MongoDB driver assemblies (MongoDB.*.dll) in the following locations:
  1. bin folder of xConnect Collection and xConnect Collection Search roles.
  2. App_data\jobs\continuous\IndexWorker folder of xConnect Collection Search role.

Update Instructions For Session State Provider For 9.0.0-9.1.1 

The following instructions are applicable to
If Mongo session state provider is used on the solution, overwrite all MongoDB driver assemblies (MongoDB.*.dll) in the bin folder of your Sitecore XP roles