---
title: "Disable a patch file"
slug: "disable-a-patch-file"
abstract: "If you want to restore the server configuration to its default settings, you can disable your patch files."
---
# Disable a patch file

You can use [patch files](https://doc.sitecore.com/sai/en/developers/sitecoreai/development/use-a-patch-file-to-customize-the-sitecore-configuration.html "Use a patch file to customize the Sitecore configuration") to customize the configuration of the SitecoreAI 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
- Disable all patch files in a layer

## 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](https://doc.sitecore.com/sai/en/developers/sitecoreai/development/configuration-layers.html "Configuration layers") 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. SitecoreAI 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 SitecoreAI loads, it ignores all configuration files in the layer.
