Skip to content

Instantly share code, notes, and snippets.

@kamsar
Last active April 9, 2017 20:35
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save kamsar/8096336f141c0e5e97b3 to your computer and use it in GitHub Desktop.
Save kamsar/8096336f141c0e5e97b3 to your computer and use it in GitHub Desktop.
Sitecore 8 Patched SwitchMasterToWeb.config
<?xml version="1.0" encoding="utf-8" ?>
<!--
Purpose: This include file simplifies the setup of Sitecore CD instances by removing any references to the Master database from Sitecore configuration files.
This include file should be used only on CD servers.
Important: Include files are applied in alphabetical order. Therefore this include file cannot remove any references to the Master database
that are defined in include files that are applied later. In this situation, you must rename this include file so that it is applied after
any other include files that contain references to "master" database.
To enable this include file, rename it to have a ".config" extension.
-->
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/">
<sitecore>
<settings>
<setting name="Analytics.DefaultDefinitionDatabase" value="web"/>
<!-- PATCH: Redirect xDB master db-->
<setting name="ExperienceAnalytics.Api.MasterDatabase" value="web" patch:instead="setting[@name='ExperienceAnalytics.Api.MasterDatabase']"/>
<!-- PATCH: Redirect social index -->
<setting name="ListManagement.Database" value="web" patch:instead="setting[@name='ListManagement.Database']"/>
<!-- PATCH: Redirect social index -->
<setting name="Social.Messages.SearchIndex.Master" value="social_messages_web" patch:instead="setting[@name='Social.Messages.SearchIndex.Master']"/>
</settings>
<sites>
<site name="shell" set:content="web" />
<site name="modules_shell" set:content="web" />
<site name="testing">
<patch:delete />
</site>
</sites>
<IDTable>
<param connectionStringName="master" set:connectionStringName="web" />
</IDTable>
<databases>
<database id="master">
<patch:delete />
</database>
</databases>
<search>
<configuration>
<indexes>
<index>
<locations>
<master>
<patch:delete />
</master>
</locations>
</index>
</indexes>
</configuration>
</search>
<scheduling>
<agent type="Sitecore.Tasks.CleanupFDAObsoleteMediaData">
<databases hint="raw:AddDatabase">
<database name="master">
<patch:delete />
</database>
</databases>
</agent>
<agent type="Sitecore.Tasks.DatabaseAgent">
<patch:delete />
</agent>
<agent type="Sitecore.Tasks.DatabaseAgent">
<patch:delete />
</agent>
<agent type="Sitecore.Tasks.DatabaseAgent" method="Run" interval="00:10:00">
<param desc="database">core</param>
<param desc="schedule root">/sitecore/system/tasks/schedules</param>
<LogActivity>true</LogActivity>
</agent>
<agent type="Sitecore.Tasks.PublishAgent">
<patch:delete/>
</agent>
<agent type="Sitecore.ContentSearch.Tasks.Optimize">
<indexes hint="list">
<index>
sitecore_master_index<patch:delete/>
</index>
</indexes>
</agent>
<agent type="Sitecore.Analytics.Tasks.EmailReportsTask, Sitecore.Analytics">
<patch:delete />
</agent>
<agent type="Sitecore.Analytics.Tasks.SubscriptionTask, Sitecore.Analytics">
<patch:delete />
</agent>
</scheduling>
<contentSearch>
<configuration>
<indexes>
<index id="sitecore_master_index">
<patch:delete />
</index>
<index id="sitecore_fxm_master_index">
<patch:delete />
</index>
<!-- PATCH: Remove marketing master index -->
<index id="sitecore_marketing_asset_index_master">
<patch:delete/>
</index>
<!-- PATCH: Remove testing index (note: uses syncMaster strategy and the only indexed locations are in master, so I assume it should go) -->
<index id="sitecore_testing_index">
<patch:delete/>
</index>
<!-- PATCH: Remove suggested test index (note: uses syncMaster strategy and the only indexed locations are in master, so I assume it should go) -->
<index id="sitecore_suggested_test_index">
<patch:delete/>
</index>
<!-- PATCH: Remove FXM domains master index (note: uses syncMaster strategy and the only indexed locations are in master, so I assume it should go) -->
<analytics_fxm_domains_index_master id="sitecore_fxm_domains_master">
<patch:delete />
</analytics_fxm_domains_index_master>
<!-- PATCH: Remove list index (note: uses syncMaster strategy and the only indexed locations are in master, so I assume it should go) -->
<index id="sitecore_list_index">
<patch:delete/>
</index>
<!-- PATCH: Remove social messages master index (note: uses syncMaster strategy and the only indexed locations are in master, so I assume it should go) -->
<index id="social_messages_master">
<patch:delete/>
</index>
</indexes>
</configuration>
<!-- PATCH: Added indexConfigurations to make the transform take effect (parent path was out of date) -->
<indexConfigurations>
<indexUpdateStrategies>
<syncMaster>
<patch:delete />
</syncMaster>
<intervalAsyncMaster>
<patch:delete />
</intervalAsyncMaster>
</indexUpdateStrategies>
</indexConfigurations>
</contentSearch>
<!-- PATCH: remove master dataview -->
<dataviews>
<dataview name="Master">
<patch:delete/>
</dataview>
</dataviews>
<!-- PATCH: redirect taxonomy repository -->
<taxonomy>
<repositories>
<itemTaxonomyRepository>
<param desc="databaseName">web</param>
</itemTaxonomyRepository>
</repositories>
</taxonomy>
<!-- PATCH: redirect reporting definition databases -->
<reporting>
<dataProvider>
<datasources>
<add key="item">
<FiltersFactory>
<param desc="definitionDatabaseName">web</param>
</FiltersFactory>
</add>
<add key="collection">
<FiltersFactory>
<param desc="definitionDatabaseName">web</param>
</FiltersFactory>
</add>
<add key="reporting">
<FiltersFactory>
<param desc="definitionDatabaseName">web</param>
</FiltersFactory>
</add>
</datasources>
</dataProvider>
</reporting>
<!-- PATCH: redirect marketing definitions database, asset database and index, goal database, outcome database -->
<marketingDefinitions>
<campaign>
<repositories>
<item>
<param desc="databaseName">web</param>
</item>
</repositories>
</campaign>
<asset>
<repositories>
<item>
<param desc="databaseName">web</param>
<param desc="indexName">sitecore_marketing_asset_index_web</param>
</item>
</repositories>
</asset>
<goal>
<repositories>
<item>
<param desc="databaseName">web</param>
</item>
</repositories>
</goal>
<outcome>
<repositories>
<item>
<param desc="databaseName">web</param>
</item>
</repositories>
</outcome>
</marketingDefinitions>
<!-- PATCH: redirect list rule engine database -->
<ruleEngine>
<param desc="ruleDatabaseName">web</param>
</ruleEngine>
</sitecore>
</configuration>
@jst-cyr
Copy link

jst-cyr commented Mar 16, 2016

Hey Kam, I ran into an issue on Update 5 where the standard OOTB SMTW had a hook being removed that wasn't in this patch. I forked and made the patch, but apparently no way to pull request back.
Take a look if you have a moment!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment