Utility Spotlight: Migrate from Windows XP to Windows 7

The Microsoft User State Migration Tool can ease the process of migrating to Windows 7 by helping you bring along users’ files and settings.

Lance Whitney

When you upgrade from Windows XP to Windows 7, you need to migrate your users’ files and settings. The Microsoft User State Migration Tool (USMT) can help with that process.

The USMT can capture user accounts from a Windows XP computer with all their files and settings intact. It can then transfer them to a new machine or the same PC running Windows 7. The USMT will migrate documents, e-mail, desktop settings and Internet Explorer favorites. It can also transfer certain Microsoft and third-party application settings.

The USMT is similar to the Windows Easy Transfer Companion. However, this utility has advanced options and customization. You can also more easily automate operations. With the USMT, you transfer user files and settings from the XP computer into a compressed MIG file. Store this file on a network share and apply it to the new Windows 7 environment.

Direct Flight

The latest version of USMT (version 4.0) is designed to move users from Windows XP to Windows 7, an upgrade for which there is no direct path. You can also use it to move from Windows XP to Windows Vista or from Windows Vista to Windows 7.

The USMT can even transfer files and settings from a 32-bit OS to a 64-bit OS. It can handle a migration from one computer to another, and it can migrate files and settings on the same physical computer if you plan to remove Windows XP and install Windows 7. If you’ll be using the same PC, there’s a hard-link option in version 4.0 that keeps the user folders intact. It simply links to them from the new OS.

The USMT is part of the Microsoft Windows Automated Installation Kit (WAIK). This also includes various tools to help you configure and deploy Windows.

To get started, first download and install the latest release of the WAIK onto a test PC running Windows XP. You’ll find the WAIK at the Microsoft Download Center. The installation file KB3AIK_EN.iso comes in the form of an ISO file, so you’ll need to either burn it to a CD or use a virtual drive utility to install it directly.

Installing the WAIK is fairly straightforward. You just need to make sure your Windows XP computer has the Microsoft .NET Framework 2.0 or later and Microsoft XML Core Service 6.0. After you’ve installed the WAIK, you’ll find the 32-bit USMT files in the following folder: C:\Program Files\Windows AIK\Tools\USMT\x86. Microsoft recommends copying the entire USMT folder from your test PC to a network share. From the network, you can then copy the folder to each client to avoid having to install the WAIK on every PC.

Direct Commands

The USMT is a command-line utility, so you’ll need to open a command prompt for the local USMT/x86 folder. To transfer the files and settings for all user accounts on the computer, run the command scanstate, followed by the necessary configuration options. You can type scanstate /? to see all the available options.

You’ll need to specify the location where you wish to save the MIG file, such as a network share. You’ll also want to point to two default configuration files that scanstate uses—MigApp.xml and MigDocs.xml. These two files include default settings, but you can modify them to suit your environment.

Additionally, you may want to include the /o switch to overwrite a previously saved MIG file. The /c option forces the scanstate command to continue in the event of non-fatal errors. There will be a log file generated by default in the USMT folder. You can also specify a different location.

Using this example, you’d type the following command: scanstate \\server\share\folder /o /c /i:migapp.xml /i:migdocs.xml. Scanstate will then capture the necessary files and settings (see Figure 1) in the USMT.MIG file within a folder called USMT at the location you specified.

Figure 1 The USMT Scanstate command captures all files and settings

Figure 1 The USMT Scanstate command captures all files and settings

After you install and set up Windows 7 with all the necessary applications, you can apply the MIG file to load captured files and settings. You can copy the USMT folder from your network to the Windows 7 PC or run it directly from the network. Either way, you’ll need to open an elevated command prompt to the USMT/x86 folder (or the USMT/AMD64 folder if you’re using a 64-bit version of Windows 7).

The command to load the MIG file is called loadstate. Type loadstate /? at the prompt and you’ll see all the options. As with the scanstate command, you’ll need to specify the location of the MIG file. You can also add the /c option to continue on non-fatal errors.

Specify the two XML files you pointed to in the scanstate command. Finally, use two additional options called /lac and /lae that tell USMT to create and enable any local accounts from the Windows XP computer that don’t exist on the Windows 7 PC. So, in this example, your command would read:

loadstate \\server\usershare /c /lac /lae /i:migapp.xml /i:migdocs.xml

USMT then applies the files and settings from the MIG file (see Figure 2). After the migration is complete, you can check the Windows 7 computer to ensure that all the appropriate files and settings have been transferred.

Figure 2 The files and settings stored in the MIG file are applied to a new machine

Figure 2 The files and settings stored in the MIG file are applied to a new machine

You can create batch files or other scripts to automate the process and run both the scanstate and loadstate commands with the necessary options on each client. Execute those scripts before and after setting up each individual PC.

Microsoft provides a helpful online video that explains how to use USMT and set up a batch file. You’ll also find a detailed User’s Guide for the USMT in the Microsoft TechNet library.

Overall, the USMT is an effective way to transfer user files and settings during a Windows migration. It’s worth considering if you’re making the switch to Windows 7.

Lance Whitney

Lance Whitney is a writer, IT consultant and software trainer. He’s spent countless hours tweaking Windows workstations and servers. Originally a journalist, he took a blind leap into the IT world in the early ’90s.