Share via


USMT XML To Include All AppData

Question

Monday, June 18, 2018 6:11 PM

I am trying to get the XML right to include everything in the user's AppData folder excluding some folders. I can't seem to get it to work though.  Here is what I have come up with, but does not successfully grab the data. I placed the below XML into a MigCustom.xml file.

<!-- Migrates all roaming AppData excluding some unwanted files and folders -->
  <component type="System" context="User"> 
    <displayName _locID="miguser.RoamingAppData">Roaming AppData</displayName> 
      <role role="Settings">
          <rules> 
              <Include filter="MigXmlHelper.IgnoreIrrelevantLinks()">
                    <objectSet> 
                      <pattern type="File">%CSIDL_APPDATA%\* [*]</pattern>
                  </objectSet>
              </Include> 
              <Exclude> 
                  <objectSet>
                        <pattern type="File">%CSIDL_APPDATA%\Adobe\* [*]</pattern>
                        <pattern type="File">%CSIDL_APPDATA%\Microsoft\* [*]</pattern>
                        <pattern type="File">%CSIDL_APPDATA%\Macromedia\* [*]</pattern>
                        <pattern type="File">%CSIDL_APPDATA%\Sun\* [*]</pattern>
                        <pattern type="File">%CSIDL_APPDATA%\Mozilla*\* [*]</pattern><!-- The MigApp.xml file contains info about migrating Firefox data -->
                        <pattern type="File">%CSIDL_APPDATA%\Google*\* [*]</pattern><!-- The MigApp.xml file contains info about migrating Chrome data -->
                  </objectSet> 
              </Exclude>
              <Merge script="MigXmlHelper.SourcePriority()">
                <objectSet> 
                    <pattern type="File">%CSIDL_APPDATA%\* [*]</pattern>
                </objectSet>
              </Merge>
          </rules> 
      </role> 
    </component>

    <!-- Migrates all local AppData excluding some unwanted files and folders -->
  <component type="System" context="User"> 
    <displayName _locID="miguser.LocalAppData">Local AppData</displayName> 
      <role role="Settings">
          <rules> 
              <Include filter="MigXmlHelper.IgnoreIrrelevantLinks()">
                    <objectSet> 
                      <pattern type="File">%CSIDL_LOCAL_APPDATA%\* [*]</pattern>
                  </objectSet>
              </Include> 
              <Exclude> 
                  <objectSet>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\Adobe\* [*]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\Apps\* [*]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\CEF\* [*]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\Comms\* [*]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\ConnectedDevicesPlatform\* [*]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\DBG\* [*]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\Deployment\* [*]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\Diagnostics\* [*]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\Google\* [*]</pattern><!-- The MigApp.xml file contains info about migrating Chrome data -->
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\GroupPolicy\* [*]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\Intel\* [*]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\IsolatedStorage\* [*]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\Microsoft\* [*]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\Microsoft Help\* [*]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\Microsoft_Corporation\* [*]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\Mozilla*\* [*]</pattern><!-- The MigApp.xml file contains info about migrating Firefox data -->
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\PackageManagement\* [*]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\Packages\* [*]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\PlaceholderTileLogoFolder\* [*]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\Programs\* [*]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\Publishers\* [*]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\ServiceHub\* [*]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\Temp\* [*]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\VirtualStore\* [*]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\vNext\* [*]</pattern>
                  </objectSet> 
              </Exclude>
              <Merge script="MigXmlHelper.SourcePriority()">
                <objectSet> 
                    <pattern type="File">%CSIDL_LOCAL_APPDATA%\* [*]</pattern>
                </objectSet>
              </Merge>
          </rules> 
      </role> 
    </component>

All replies (8)

Wednesday, June 19, 2019 6:01 PM âś…Answered

Using this will copy all including roaming data

<?xml version="1.0" encoding="UTF-8"?>
<migration urlid="http://www.microsoft.com/migration/1.0/migxmlext/AppDataMig">

    <component context="User" type="Application">
        <displayName>Local AppData</displayName>
        <paths>
            <path type="File">%CSIDL_LOCAL_APPDATA%</path>
        </paths>
        <role role="Settings">
            <rules>
                <include filter='MigXmlHelper.IgnoreIrrelevantLinks()'>
                    <objectSet>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\* [*]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\* [*]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\* [*]</pattern>
                    </objectSet>
                </include>
                <merge script="MigXmlHelper.DestinationPriority()">
                    <objectSet>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\* [*]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\* [*]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\* [*]</pattern>
                    </objectSet>
                </merge>
            </rules>
        </role>
    </component>


    <component context="User" type="Application">
        <displayName>Roaming AppData</displayName>
        <paths>
            <path type="File">%CSIDL_LOCAL_APPDATA%</path>
        </paths>
        <role role="Settings">
            <rules>
                <include filter='MigXmlHelper.IgnoreIrrelevantLinks()'>
                    <objectSet>
                        <pattern type="File">%CSIDL_APPDATA%\* [*]</pattern>
                        <pattern type="File">%CSIDL_APPDATA%\* [*]</pattern>
                        <pattern type="File">%CSIDL_APPDATA%\* [*]</pattern>
                    </objectSet>
                </include>
                <merge script="MigXmlHelper.DestinationPriority()">
                    <objectSet>
                        <pattern type="File">%CSIDL_APPDATA%\* [*]</pattern>
                        <pattern type="File">%CSIDL_APPDATA%\* [*]</pattern>
                        <pattern type="File">%CSIDL_APPDATA%\* [*]</pattern>
                    </objectSet>
                </merge>
            </rules>
        </role>
    </component>

    </migration>

Tuesday, June 19, 2018 9:39 AM

Hi,

I am not that familiar with USMT but try taking a look at modifying the xml file. Look at the excludes in the examples on https://github.com/gioxx/USMT/blob/master/MigDomCustom7.xml . It includes migrates AppData (Local, Roaming, LocalLow) script.

https://social.technet.microsoft.com/Forums/systemcenter/en-US/9c1054e4-8290-4625-89df-caf7c3b40350/migration-app-data-using-usmt?forum=configmgrgeneral

Unless you have a very specific use case, I personally wouldn't bother migrating App Data, only some applications will work gracefully by moving it and honestly a lot of it just isn't useful. Move Documents, Downloads, Desktop, Photos and Pictures into the new profile.

Regards,

Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected].


Wednesday, June 20, 2018 3:31 PM

The reason why I want AppData in general to be moved is because there are a lot of different apps in the environment and sometimes new apps get installed. I'd end up building a custom xml file for every computer every time I needed to migrate a profile.

The Documents folder is redirected to a server share (with Offline Files turned on), so I only need USMT to migrate AppData.

I will try this XML out, thanks.


Wednesday, June 20, 2018 5:22 PM

Unfortunately it didn't pull over the files I hoped it would. I am so confused as to how to build the XML now.


Tuesday, June 26, 2018 12:23 PM

With the courtesy of Thomas Ehler, Ehlertech I have cut this Component from his Win10.xml as I am NOT very good at USMT XML's.

    <!-- This components migrates the Tiles database -->
   <component context="User" type="Application">
        <displayName>TilesLayerAndStartmenu</displayName>
        <paths>
            <path type="File">%CSIDL_LOCAL_APPDATA%</path>
        </paths>
        <role role="Settings">
            <rules>
                <include filter='MigXmlHelper.IgnoreIrrelevantLinks()'>
                    <objectSet>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\Microsoft\Windows\Caches\* [*]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\Microsoft\Windows\CloudStore\* [*]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\Microsoft\Windows\Explorer\* [*]</pattern>
                    </objectSet>
                </include>
                <merge script="MigXmlHelper.DestinationPriority()">
                    <objectSet>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\Microsoft\Windows\Caches\* [*]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\Microsoft\Windows\CloudStore\* [*]</pattern>
                        <pattern type="File">%CSIDL_LOCAL_APPDATA%\Microsoft\Windows\Explorer\* [*]</pattern>
                    </objectSet>
                </merge>
            </rules>
        </role>
    </component>

Here some folders in Appdata/Local are copied and I know for a fact this works!
In your case I'd probably replace MigXmlHelper.DestinationPriority() with .SourcePriority()

See more here https://technet.microsoft.com/da-dk/library/hh824899.aspx#MergeFunctions

For your Exclude section I'd use <unconditionalExclude>

(The MigXmlHelper.IgnoreIrrelevantLinks() just skips .lnk files pointing to things not on the target PC.)


Wednesday, May 1, 2019 11:36 PM

I tried this.  The microsoft folders copy, but no others I add to the xml will move.


Thursday, June 20, 2019 11:26 PM

I haven't tried this yet, but I'm going to assume it works. I won't be able to try it for a while yet.


Tuesday, November 5, 2019 7:53 PM

Hello,

Can anyone provide me the XML to just migrate a specified folder from the Appdata Roaming? We want to exclude  everything in the roaming folder except for certain folders. I am having trouble writing the XML block for this part, but can modify the xml as needed.

The folder we want to migrate is appData\Roaming\Microsoft\Templates.

Thank  You in advance!