Skip to content

Instantly share code, notes, and snippets.

@kamsar
Created December 5, 2016 22:17
Show Gist options
  • Save kamsar/f84dd34e5f77c61dd9b130dc78d8f1f0 to your computer and use it in GitHub Desktop.
Save kamsar/f84dd34e5f77c61dd9b130dc78d8f1f0 to your computer and use it in GitHub Desktop.
Sitecore 8.2 Update 1 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. The include files in root folder are applied before the include files in the subdirectories.
The subdirectories 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>
<hooks>
<hook type="Sitecore.ExperienceAnalytics.Reduce.SubSystemLoader, Sitecore.ExperienceAnalytics">
<patch:delete />
</hook>
<hook type="Sitecore.Marketing.Taxonomy.Hooks.DeployInitializer, Sitecore.Marketing.Taxonomy">
<patch:delete />
</hook>
<hook type="Sitecore.Analytics.BackgroundServiceLoader, Sitecore.Analytics">
<patch:delete />
</hook>
<hook type="Sitecore.Analytics.Aggregation.AggregationLoader, Sitecore.Analytics.Aggregation">
<patch:delete />
</hook>
<hook type="Sitecore.Analytics.Automation.Aggregation.SubsystemLoader, Sitecore.Analytics.Automation.Aggregation">
<patch:delete />
</hook>
<hook type="Sitecore.Analytics.Processing.ProcessingLoader, Sitecore.Analytics.Processing">
<patch:delete />
</hook>
<hook type="Sitecore.PathAnalyzer.Processing.SubsystemLoader, Sitecore.PathAnalyzer">
<patch:delete />
</hook>
</hooks>
<settings>
<setting name="Analytics.DefaultDefinitionDatabase" set:value="web"/>
<setting name="ExperienceAnalytics.Api.MasterDatabase" set:value="web"/>
<setting name="ListManagement.Database" set:value="web"/>
<setting name="Social.Messages.SearchIndex.Master" set:value="social_messages_web"/>
<setting name="Analytics.PerformLookup" set:value="false" />
</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>
<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>
<agent type="Sitecore.ListManagement.Analytics.UnlockContactListsAgent, Sitecore.ListManagement.Analytics">
<patch:delete />
</agent>
<agent type="Sitecore.Social.Client.Tasks.ManagePreExpiredAccounts, Sitecore.Social.Client">
<patch:delete />
</agent>
</scheduling>
<contentSearch>
<configuration>
<indexes>
<index id="sitecore_master_index">
<patch:delete />
</index>
<index id="sitecore_marketing_asset_index_master">
<patch:delete/>
</index>
<index id="sitecore_marketingdefinitions_master">
<patch:delete />
</index>
<index id="sitecore_testing_index">
<patch:delete/>
</index>
<index id="sitecore_suggested_test_index">
<patch:delete/>
</index>
<index id="sitecore_fxm_master_index">
<patch:delete />
</index>
<index id="sitecore_list_index">
<patch:delete/>
</index>
<index id="social_messages_master">
<patch:delete/>
</index>
</indexes>
</configuration>
<indexConfigurations>
<indexUpdateStrategies>
<syncMaster>
<patch:delete />
</syncMaster>
<intervalAsyncMaster>
<patch:delete />
</intervalAsyncMaster>
</indexUpdateStrategies>
</indexConfigurations>
</contentSearch>
<dataviews>
<dataview name="Master">
<patch:delete/>
</dataview>
</dataviews>
<taxonomy>
<repositories>
<itemTaxonomyRepository>
<param desc="databaseName">web</param>
</itemTaxonomyRepository>
</repositories>
</taxonomy>
<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>
<marketingDefinitions>
<sc.variable name="marketingDefinitions.isReadOnly">
<patch:attribute name="value">true</patch:attribute>
</sc.variable>
<sc.variable name="marketingDefinitions.repositories.item.assumeActive">
<patch:attribute name="value">true</patch:attribute>
</sc.variable>
<campaign>
<definitionManager>
<param desc="searchProvider">
<patch:attribute name="ref">marketingDefinitions/campaign/searchProviders/notSupported</patch:attribute>
</param>
<config>
<activationFeed>
<patch:delete/>
</activationFeed>
<activationFeed />
</config>
</definitionManager>
</campaign>
<asset>
<definitionManager>
<param desc="searchProvider">
<patch:attribute name="ref">marketingDefinitions/asset/searchProviders/notSupported</patch:attribute>
</param>
<config>
<activationFeed>
<patch:delete/>
</activationFeed>
<activationFeed />
</config>
</definitionManager>
<repositories>
<item>
<param desc="indexName">sitecore_marketing_asset_index_web</param>
</item>
</repositories>
</asset>
<goal>
<definitionManager>
<param desc="searchProvider">
<patch:attribute name="ref">marketingDefinitions/goal/searchProviders/notSupported</patch:attribute>
</param>
<config>
<activationFeed>
<patch:delete/>
</activationFeed>
<activationFeed />
</config>
</definitionManager>
</goal>
<outcome>
<definitionManager>
<param desc="searchProvider">
<patch:attribute name="ref">marketingDefinitions/outcome/searchProviders/notSupported</patch:attribute>
</param>
<config>
<activationFeed>
<patch:delete/>
</activationFeed>
<activationFeed />
</config>
</definitionManager>
</outcome>
<itemRepositoriesDatabase>web</itemRepositoriesDatabase>
<searchIndexName>sitecore_marketingdefinitions_web</searchIndexName>
</marketingDefinitions>
<ruleEngine>
<param desc="ruleDatabaseName">web</param>
</ruleEngine>
<hooks>
<hook type="Sitecore.Marketing.Taxonomy.Hooks.DeployInitializer, Sitecore.Marketing.Taxonomy">
<patch:delete />
</hook>
</hooks>
</sitecore>
</configuration>
@kikid2
Copy link

kikid2 commented Mar 14, 2018

I'm having At line:15 char:3

  • -->
  • ~
    Missing expression after unary operator '--'.
    At line:15 char:4
  • -->
  • ~
    Missing file specification after redirection operator.
    + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : MissingExpressionAfterOperator

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