Disable a patch file
You can use patch files to customize the configuration of the Sitecore server. If you want to return the server configuration to its default settings, you can disable your patch files temporarily without having to delete them.
This topic describes how to:
Disable a single patch file
To disable a single patch file, you can do one of two things:
-
Navigate to the patch file in the file system, and rename it to end in something other than
.config
. For example, renameSitecore.Analytics.Config
toSitecore.Analytics.Config.Disabled.
-
Add the patch file to a
<loadOrder>
section and add themode="Off"
attribute. For example:<add path="Sitecore.Analytics.Config" type="File" mode="Off" />
Disable all patch files in a layer
You can disable all patch files in a layer to quickly restore a customized test or development environment to the default settings, without having to remove the patch files.
This method disables both your patch files and Sitecore's own configuration files.
To temporarily disable all configuration files in a layer:
-
Open the
Website/App_Config/layers.config
file. -
Locate the relevant layer definition string, for example, the Environment layer.
ImportantDo not disable the Sitecore layer or the Modules layer. Sitecore will not load correctly if the configuration files in these layers are disabled.
-
Add the
mode="off"
attribute to the layer definition. For example, to disable all the configuration files in the Environment layer:RequestResponse<layer name="Environment" includefolder="/App_config/Environment/" mode="off"> … </layer>
Now, when Sitecore loads, it ignores all configuration files in the layer.
You can use the Show Config tool to see the resulting configuration as it looks when Sitecore compiles it at runtime. You can also use the Show Config tool to simulate changing the configuration rules or disabling configuration layers without actually changing the configuration.