In some special cases, we need to re-create a new local profile for a user, and then re-import some files/folders/HKCU registry keys from his former profile.
The process we'd like to use : - Full backup of old user profile (anything, files, registry) - Delete the C:\Users\ folder and profile infos in registry - Re-import some files and reg key (not all)
Some guys pointed out that Microsoft has a tool for this called USMT and i tried the following : - Save the whole user profile using this XML config :
<?xml version="1.0" encoding="UTF-8"?>
<_locDefinition>
<_locDefault _loc="locNone"/>
<_locTag _loc="locData">displayName</_locTag>
</_locDefinition>
<!-- Profile files -->
<component type="Documents" context="User">
<displayName>Files Migration</displayName>
<role role="Data">
<rules>
<!-- Anything ... -->
<include>
<objectSet>
<pattern type="File">%CSIDL_PROFILE%\* [*]</pattern>
</objectSet>
</include>
<!-- ... Except -->
<unconditionalExclude>
<objectSet>
<!-- Reg files -->
<pattern type="File">%CSIDL_PROFILE%\ [NTUSER.*]</pattern>
<pattern type="File">%CSIDL_LOCAL_APPDATA%\Microsoft\Windows\ [UsrClass.dat]</pattern>
<!-- IE Cache -->
<pattern type="File">%CSIDL_INTERNET_CACHE%\* [*]</pattern>
<!-- Temp -->
<pattern type="File">%TEMP%\* [*]</pattern>
</objectSet>
</unconditionalExclude>
</rules>
</role>
</component>
<!-- Registry -->
<component type="System" context="User">
<displayName>Registry Migration</displayName>
<role role="Settings">
<rules>
<!-- Get all HCKU -->
<include>
<objectSet>
<pattern type="Registry">HKCU\* [*]</pattern>
</objectSet>
</include>
</rules>
</role>
</component>
CommandLine for saving using ScanState.exe :
/listfiles:"C:\Logs\saved.log" /i:"C:\ProgramData\RebuildProfil\Conf\UserFull.xml" /ui:*\myuser/ue:*\* /hardlink /nocompress /o /v:13
Seems to work fine so far... After profile deletion, il use LoadState.exe with following XML :
<?xml version="1.0" encoding="UTF-8"?>
<_locDefinition>
<_locDefault _loc="locNone"/>
<_locTag _loc="locData">displayName</_locTag>
</_locDefinition>
<!-- This component migrates My Music files -->
<component type="Documents" context="User">
<displayName _locID="miguser.mymusic">My Music</displayName>
<paths>
<path type="File">%CSIDL_MYMUSIC%</path>
</paths>
<role role="Data">
<detects>
<detect>
<condition>MigXmlHelper.DoesObjectExist("File","%CSIDL_MYMUSIC%")</condition>
</detect>
</detects>
<rules>
<include filter='MigXmlHelper.IgnoreIrrelevantLinks()'>
<objectSet>
<pattern type="File">%CSIDL_MYMUSIC%\* [*]</pattern>
</objectSet>
</include>
<merge script="MigXmlHelper.DestinationPriority()">
<objectSet>
<pattern type="File">%CSIDL_MYMUSIC%\ [desktop.ini]</pattern>
</objectSet>
</merge>
</rules>
</role>
</component>
The commandline :
/i:"C:\ProgramData\RebuildProfil\Conf\MigUserProfile.xml" /ui:*\myuser /ue:*\* /hardlink /nocompress /v:13
And instead of just migrating "My Music" files, the full user profile gets recreated (all files, all registry keys), doesn't seems the infos from the XML are taken into account.
So i wonder : 1- if it is possible to specify different XML files to scanstate and loadstate 2- if it is possible to only migrate some part of what was saved in the migration store
Any advice ? Thanks !