Disable a patch file

Last updated Wednesday, October 18, 2017 in Sitecore Experience Platform for Administrator, Developer
Keywords: Configuration, xDB

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, rename Sitecore.Analytics.Config to Sitecore.Analytics.Config.Disabled.
  • Add the patch file to a <loadOrder> section and add the mode="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.

Note

This method disables both your patch files and Sitecore's own configuration files.

To temporarily disable all configuration files in a layer:

  1. Open the Website/App_Config/layers.config file.
  2. Locate the relevant layer definition string, for example, the Environment layer.

    Important

    Do not disable the Sitecore layer or the Modules layer. Sitecore will not load correctly if the configuration files in these layers are disabled.

  3. Add the mode="off" attribute to the layer definition. For example, to disable all the configuration files in the Environment layer:
    <layer name="Environment" includefolder="/App_config/Environment/" mode="off">
    </layer>

Now, when Sitecore loads, it ignores all configuration files in the layer.

Note

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.

Send feedback about the documentation to docsite@sitecore.net.