Introduction

USMT allows you to save user data with the intention of restoring it on a new system. For instance, you can migrate user data from a Windows 7 PC to a new Windows 10 PC. USMT is available with the Windows ADK, which you can download from Microsoft.

After installing the ADK, USMT is located at: C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\User State Migration Tool

USMT can also save data from an x86 system and restore it to an x64 system, but not vice versa.

USMT XML Configuration Files

USMT uses XML files to configure what data is saved and restored:

  • MigDocs.xml: Saves files globally.
  • MigUser.xml: Saves user profile data. Use this file to save user desktop, favorites, documents, pictures, etc.
  • MigApp.xml: Saves application data, mainly for Microsoft applications. Useful for restoring Outlook configurations.

Note: Never use MigUser.xml and MigDocs.xml together.

Modifying MigUser.xml

You may need to modify MigUser.xml to save specific extensions that are not included in user profiles. For example, to add additional file extensions:

<?xml version="1.0" encoding="UTF-8"?>
<components>
    <component name="User Data">
        <script>MigXmlHelper.GenerateDrivePatterns("*[*.rar]", "Fixed")</script>
        <script>MigXmlHelper.GenerateDrivePatterns("*[*.psd]", "Fixed")</script>
        <script>MigXmlHelper.GenerateDrivePatterns("*[*.dw*]", "Fixed")</script>
        <script>MigXmlHelper.GenerateDrivePatterns("*[*.pdf]", "Fixed")</script>
        <script>MigXmlHelper.GenerateDrivePatterns("*[*.jpg]", "Fixed")</script>
        <script>MigXmlHelper.GenerateDrivePatterns("*[*.png]", "Fixed")</script>
    </component>
</components>

To restore data to a different folder, modify the location:

<locationModify script="MigXmlHelper.Move('%SYSTEMDRIVE%\AncienPC')"></locationModify>

Creating a Configuration File (Genconfig)

If you don’t want to use all settings in MigUser.xml and MigApp.xml, create a configuration file:

<USMT10>\amd64\scanstate.exe /genconfig:<USMT10>\amd64\config.xml /i:<USMT10>\amd64\MigUser.xml /i:<USMT10>\amd64\migapp.xml

Modify the new config.xml file to disable components by setting migrate="no" for each component.

Command Line Usage

Use the following commands to save and restore user data:

Saving Data

scanstate.exe "savepath" /v:13 /c /o /ue:Administrateur /localonly /i:<USMT10>\amd64\MigApp.xml /i:<USMT10>\amd64\MigUser.xml /config:<USMT10>\amd64\config.xml /l:"logpath.log"

Parameters:

  • /o: Overwrites existing data.
  • /c: Continues on non-critical errors.
  • /localonly: Ignores UNC paths.
  • /config: Uses the configuration file.
  • /ue: Excludes specified account.

Restoring Data

loadstate.exe "savepath" /v:13 /c /lac /i:<USMT10>\amd64\MigApp.xml /i:<USMT10>\amd64\MigUser.xml /l:"logpath.log"

Parameters:

  • /lac: Creates a local account if it doesn’t exist.
  • /lac:password /lae: Specifies and activates the local account password.

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.