---
title: Conflicts and Precedence (Windows 10)
description: Conflicts and Precedence
ms.assetid: 0e2691a8-ff1e-4424-879b-4d5a2f8a113a
ms.prod: w10
ms.mktglfcycl: deploy
ms.sitesec: library
author: greg-lindsay
ms.date: 04/19/2017
---
# Conflicts and Precedence
When you include, exclude, and reroute files and settings, it is important to know how User State Migration Tool (USMT) 10.0 deals with conflicts and precedence. When working with USMT, the following are the most important conflicts and precedence guidelines to keep in mind.
- **If there are conflicting rules within a component, the most specific rule is applied.** However, the <unconditionalExclude> rule is an exception because it takes precedence over all others. Directory names take precedence over file extensions. For examples, see [What happens when there are conflicting include and exclude rules?](#bkmk1) and the first example in [Include and exclude precedence examples](#precexamples)****later in this topic.
- **Only rules inside the same component can affect each other, depending on specificity.** Rules that are in different components do not affect each other, except for the <unconditionalExclude> rule.
- **If the rules are equally specific, <exclude> takes precedence over <include>.** For example, if you use the <exclude> rule to exclude a file and use the <include> rule to include the same file, the file will be excluded.
- **The ordering of components does not matter.** It does not matter which components are listed in which .xml file, because each component is processed independently of the other components across all of the .xml files.
- **The ordering of the <include> and <exclude> rules within a component does not matter.**
- **You can use the <unconditionalExclude> element to globally exclude data.** This element excludes objects, regardless of any other <include> rules that are in the .xml files. For example, you can use the <unconditionalExclude> element to exclude all MP3 files on the computer or to exclude all files from C:\\UserData.
## In This Topic
**General**
- [What is the relationship between rules that are located within different components?](#bkmk2)
- [How does precedence work with the Config.xml file?](#bkmk3)
- [How does USMT process each component in an .xml file with multiple components?](#bkmk4)
- [How are rules processed?](#bkmk5)
- [How does USMT combine all of the .xml files that I specify on the command line?](#bkmk6)
**The <include> and <exclude> rules**
- [What happens when there are conflicting include and exclude rules?](#bkmk1)
- [<include> and <exclude> precedence examples](#precexamples)
**File collisions**
- [What is the default behavior when there are file collisions?](#collisions)
- [How does the <merge> rule work when there are file collisions?](#bkmk11)
## General
### What is the relationship between rules that are located within different components?
Only rules inside the same component can affect each other, depending on specificity, except for the <unconditionalExclude> rule. Rules that are in different components do not affect each other. If there is an <include> rule in one component and an identical <exclude> rule in another component, the data will be migrated because the two rules are independent of each other.
If you have an <include> rule in one component and a <locationModify> rule in another component for the same file, the file will be migrated in both places. That is, it will be included based on the <include> rule, and it will be migrated based on the <locationModify> rule.
The following .xml file migrates all files from C:\\Userdocs, including .mp3 files, because the <exclude> rule is specified in a separate component.
``` syntax
If you have the following code in the same component | Resulting behavior | Explanation |
---|---|---|
|
Migrates all files and subfolders in Dir1 (including all .txt files in C:). |
The <exclude> rule does not affect the migration because the <include> rule is more specific. |
|
Migrates all files and subfolders in C:\Dir1, except the .txt files in C:\Dir1\Dir2 and its subfolders. |
Both rules are processed as intended. |
|
Migrates all files and subfolders in C:\Dir1, except the .txt files in C:\Dir1 and its subfolders. |
Both rules are processed as intended. |
|
Nothing will be migrated. |
The rules are equally specific, so the <exclude> rule takes precedence over the <include> rule. |
|
Migrates the .txt files in Dir1 and the .txt files from subfolders other than Dir2. No files are migrated from Dir2 or its subfolders. |
Both rules are processed as intended. |
|
Migrates all files and subfolders of Dir2, except the .txt files from Dir1 and any subfolders of Dir1 (including Dir2). |
Both rules are processed as intended. |
If you have the following code in different components | Resulting behavior | Explanation |
---|---|---|
Component 1:
Component 2:
|
Migrates all files and subfolders of C:\Dir1\ (including C:\Dir1\Dir2). |
Rules that are in different components do not affect each other, except for the <unconditionalExclude> rule. Therefore, in this example, although some .txt files were excluded when Component 1 was processed, they were included when Component 2 was processed. |
Component 1:
Component 2:
|
Migrates all files and subfolders from Dir2 except the .txt files in C:\Dir1 and its subfolders. |
Both rules are processed as intended. |
Component 1:
Component 2:
|
Migrates all .txt files in Dir1 and any subfolders. |
Component 1 does not contain an <include> rule, so the <exclude> rule is not processed. |
If you have the following code in the same component | Resulting behavior | Explanation |
---|---|---|
|
Migrates all keys in HKLM\Software\Microsoft\Command Processor except DefaultColor. |
Both rules are processed as intended. |
|
Migrates only DefaultColor in HKLM\Software\Microsoft\Command Processor. |
DefaultColor is migrated because the <include> rule is more specific than the <exclude> rule. |
|
Does not migrate DefaultColor. |
The rules are equally specific, so the <exclude> rule takes precedence over the <include> rule. |
If you have the following code in different components | Resulting behavior | Explanation |
---|---|---|
Component 1:
Component 2:
|
Migrates all the keys/values under HKLM\Software\Microsoft\Command Processor. |
Rules that are in different components do not affect each other, except for the <unconditionalExclude> rule. Therefore, in this example, the objects that were excluded when Component 1 was processed were included when Component 2 was processed. |
If you specify the following code | Resulting behavior |
---|---|
|
During ScanState, all the files will be added to the store. During LoadState, only C:\Data\SampleA.txt will be restored. |
|
During ScanState, all the files will be added to the store. During LoadState, all the files will be restored, overwriting the existing files on the destination computer. |
|
During ScanState, all the files will be added to the store. During LoadState, the following will occur:
|