Skip to content

Instantly share code, notes, and snippets.

@jst-cyr
Forked from kamsar/SwitchMasterToWeb.config
Last active March 16, 2016 18:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jst-cyr/6488cc0b6c0ab5738e9e to your computer and use it in GitHub Desktop.
Save jst-cyr/6488cc0b6c0ab5738e9e 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>
<hooks>
<hook type="Sitecore.Marketing.Taxonomy.Hooks.DeployInitializer, Sitecore.Marketing.Taxonomy">
<patch:delete />
</hook>
</hooks>
</sitecore>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment