Share via


Exclude folders during capture and restore with USMT

Question

Friday, April 4, 2014 1:40 AM

 

Hi, 

As of now i am using default configuration for USMT to do capture and restore. Its USMT 5.0 (ADK 8.0)for xp -win7 and USMT 6.3 (ADK 8.1) for win7-win7. I want to exclude some folder during capture and restore. Can anyone point me to right direction which files to modify and how to use files  with USMT once modified ?

Its a offline(Winpe)  hardlink migration .

Any pointers will be appreciated. Thanks

Regards,

All replies (6)

Friday, April 4, 2014 7:46 PM âś…Answered

yes and you can make it an unconditional exclude also, or conditional if that suits you better, (for example if C:\Data\Temp exists, then exclude it...)

here's some examples of that

<!-- UnconditionalExclude SECTION -->
    <component type="Documents" context="System">
        <displayName _locID="miguser.userdata">Common Exclusions</displayName>
        <role role="Data">
            <rules>
                <unconditionalExclude>
                    <objectSet>
                        <!--We are trying to remove system files from other windows installation on the same machine-->
                        <!-- I've moved the unconditional excludes for the WINDOWS dir to EXCLUDES due to wallpaper requirements  -->
                        <pattern type="File">%CSIDL_PROGRAM_FILES%\ [*]</pattern>
                        <pattern type="File">%CSIDL_PROGRAM_FILESX86%\ [*]</pattern>
                        <pattern type="File">%CSIDL_WINDOWS%\Media\ [*]</pattern>
                        <pattern type="File">C:\Drivers\[*]</pattern>
                        <pattern type="File">C:\MININT\[*]</pattern>
                    </objectSet>
                </unconditionalExclude>
            </rules>
        </role>
    </component>
    
<!-- Conditional exclude section -->        
        <component type="Documents" context="System">
        <displayName _locID="miguser.userdata">Conditional D Drive Exclusion</displayName>
        <role role="Data">
            <rules>
                <conditions>
                    <condition>MigXmlHelper.DoesObjectExist("File","D:\User State Migration Tool")</condition>
                </conditions>
                <unconditionalExclude>
                    <objectSet>
                        <pattern type="File">D:\ [*]</pattern>
                    </objectSet>
                </unconditionalExclude>
            </rules>
        </role>
    </component>
    <component type="Documents" context="System">
        <displayName _locID="miguser.userdata">Conditional E Drive Exclusion</displayName>
        <role role="Data">
            <rules>
                <conditions>
                    <condition>MigXmlHelper.DoesObjectExist("File","E:\User State Migration Tool")</condition>
                </conditions>
                <unconditionalExclude>
                    <objectSet>
                        <pattern type="File">E:\ [*]</pattern>
                    </objectSet>
                </unconditionalExclude>
            </rules>
        </role>
    </component>
    <component type="Documents" context="System">
        <displayName _locID="miguser.userdata">Conditional F Drive Exclusion</displayName>
        <role role="Data">
            <rules>
                <conditions>
                    <condition>MigXmlHelper.DoesObjectExist("File","F:\User State Migration Tool")</condition>
                </conditions>
                <unconditionalExclude>
                    <objectSet>
                        <pattern type="File">F:\ [*]</pattern>
                    </objectSet>
                </unconditionalExclude>
            </rules>
        </role>
    </component>

Step by Step Configuration Manager Guides > 2012 Guides | 2007 Guides | I'm on Twitter > ncbrady


Friday, April 4, 2014 9:59 AM

Hi,

To do this, Modify the migration.xml files or create a custom.xml file ,use the <exclude> elements.

Example 2: How to migrate all files located in C:\Data except files in C:\Data\tmp              

For more infomation, please review the link below:

Exclude Files and Settings

http://technet.microsoft.com/en-us/library/dd560762(v=ws.10).aspx#Ex3

We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time.
Thanks for helping make community forums a great place.


Friday, April 4, 2014 12:32 PM

If you look at the bottom of the MigUser.xml you will find some existing exclusion rules that you can examine and add your own there.

My Personal Blog: http://madluka.wordpress.com


Friday, April 4, 2014 2:23 PM

hi , 

Thanks for reply. so for e.g. if i use :

<exclude>
             <objectSet>
                   <pattern type="File"> C:\Data\temp\* [*]</pattern>
             </objectSet>
         </exclude>

does that mean it will just exclude all files inside C:\Data\temp folder it will exclude subfolders as well inside temp? I want to exclude entire folder 'temp' including files and subfolders inside it. Thanks

Regards,


Friday, April 4, 2014 7:47 PM

you can download a 'full' custom.xml file containing the snippet above from here

Step by Step Configuration Manager Guides > 2012 Guides | 2007 Guides | I'm on Twitter > ncbrady


Saturday, July 2, 2016 3:50 PM

Good morning!

I have been using USMT for a while and I have just realized that mu Custom MigDos.xml doesnt apply the changes properly. 

My main Goals is:

Capture everything on the user's profile
I would like to unconditionalExclude both folders "Google Drive" and "Dropbox".

I believe I succeeded in blocking the content of those two folders, however the folders remans in the profile. 

In order to USMT avoid both fodlers and their content, I believe I have to change my script using some sort of wildcard.

THis is the portion I have on my MigDocs.xml

<!-- This component migrates All .* Folders and their files but Dropbox -->
                <component type="Documents" context="UserAndSystem">
        <displayName>All Folders in UserProfileRoot but Dropbox</displayName>
        <role role="Data">
            <rules>
<unconditionalExclude>
<objectSet>
<pattern type="File">%CSIDL_PROFILE%\AppData\Local\Microsoft\Outlook\ [*.ost]</pattern>
<pattern type="File">%CSIDL_PROFILE%\AppData\Local\Microsoft\Office\15.0\Lync\ [*]</pattern>
<pattern type="File">C:\Program Files\ [*]</pattern>
<pattern type="File">C:\Windows\ [*]</pattern>
<pattern type="File">%CSIDL_PROFILE%\Drop*\ [*]</pattern>
<pattern type="File">%CSIDL_PROFILE%\Google*\ [*]</pattern>
</objectSet>
</unconditionalExclude>
                <include>
                    <objectSet>
                        <pattern type="File">%CSIDL_PROFILE%\* [*]</pattern>
                    </objectSet>
                </include>
            </rules>
        </role>
    </component>

Would you guys be able to tell me how I could achieve that?

THank you in advance.