Configure Sitecore roles for separate EventQueue, Properties, and Tasks tables
You can configure Sitecore roles to use EventQueue, Properties, and Tasks tables stored in a database separate from their local Web database. This can be necessary in several scenarios including when replicating the Web database using Azure active geo-replication.
To configure Sitecore roles for separate EventQueue, Properties, and Tasks tables:
-
In the
App_Config/ConnectionStrings.config
file, add an additional connection string for the new database:RequestResponseshell<add name="<CONNECTION STRING NAME>" connectionString="Data Source=<HOSTNAME>;Initial Catalog=<DATABASE>;User ID=<USER>;Password=<PASSWORD>" />
-
In the
App_Config/Include/
folder, create a folder and name it, for example,MyPatchFiles/
. -
In the
App_Config/Include/MyPatchFiles/
folder, create a configuration patch file and name it, for example,DedicatedEventQueueProvider.config.
-
In the
DedicatedEventQueueProvider.config
file, insert the following code and configureEventQueue
to use the new database connection string by changing theparam1
attribute:RequestResponsexml<?xml version="1.0" encoding="utf-8"?> <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <eventing> <eventQueueProvider> <eventQueue name="web" type="Sitecore.Data.Eventing.$(database)EventQueue, Sitecore.Kernel"> <param ref="dataApis/dataApi[@name='$(database)']" param1="<CONNECTION STRING NAME>" patch:instead="*[@param1='$(name)']"/> </eventQueue> </eventQueueProvider> </eventing> </sitecore> </configuration>
-
In the
App_Config/Include/MyPatchFiles/
folder, create a configuration patch file and name it, for example,DedicatedPropertyStoreProvider.config
. -
In the
DedicatedPropertyStoreProvider.config
file, insert the following code and configurePropertyStore
to use the new database connection string by changing theparam1
attribute:RequestResponsexml<?xml version="1.0" encoding="utf-8"?> <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <PropertyStoreProvider> <store name="web" prefix="web" getValueWithoutPrefix="true" singleInstance="true" type="Sitecore.Data.Properties.$(database)PropertyStore, Sitecore.Kernel"> <param ref="dataApis/dataApi[@name='$(database)']" param1="<CONNECTION STRING NAME>" patch:instead="*[@param1='$(name)']" /> </store> </PropertyStoreProvider> </sitecore> </configuration>
-
In the
App_Config/Include/MyPatchFiles/
folder, create a configuration patch file and name it, for example,DedicatedTaskDatabase.config
. -
In the
DedicatedTaskDatabase.config
file, insert the following code to configureTaskDatabase
to use the new database connection string by changing theconnectionStringName
attribute:RequestResponsexml<?xml version="1.0" encoding="utf-8"?> <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <TaskDatabase> <param connectionStringName="<CONNECTION STRING NAME>" patch:instead="*[@connectionStringName='web']" /> </TaskDatabase> </sitecore> </configuration>
You must repeat this procedure on every Sitecore instance.