4. Applying the Data and Settings Using LoadState
If you've captured the user state data with ScanState, you can restore it with the LoadState command. However, before you can use the LoadState
command, you need to ensure it and other required files are accessible
on the target computer. The easiest way to do so is to copy the files to
the C: drive in a folder named C:\usmt. You can use the same
steps to copy the files to the destination computer as you used to copy
them to the source computer. Alternately, you can copy the files onto a
USB drive and use them from there. You also need a copy of the USMT
store created from the ScanState command.
This section assumes the following:
If your files are located somewhere else, you'll have to modify the commands appropriately. The basic syntax of the LoadState command looks like this:
LoadState <store path> [switches]
4.1. Common LOADSTATE Switches
Just as the ScanState command has several switches you can use, the LoadState command also has several switches. Table 8 shows common switches associated with the following typical LoadState command:
c:\usmt>LoadState C:\USMTStore /i:migdocs.xm1 /i:migapp.xm1
/v:5 /l:myscanstate.1og /lac
Table 8. Basic LoadState switches
Switch | Description |
---|
/i:<fi1e name>
/i:c:\usmt\migdocs.xml
/i:c:\usmt\migapp.xml
| You use the /i switch to specify the path and XML filenames that include the rules for migration. It's common to use the MigDocs.xml and MigApp.xml files for the migration. These files include rules that will locate user data and application data. |
/v:<1eve1>
/v:5
| The /v
switch enables verbose output in the log file. The default verbosity
level is 0 and the highest is 13. You can use 0, 1, 4, 5, 8, 9, 12, or
13. |
/l:<1og fi1e name>
/l:MyLoadState.1og
| The /l switch specifies the location and name of the log file. |
/lac[:<password>]
| The local account create (/lac)
switch creates the local accounts if they don't already exist. They
start disabled and will have a blank password if the password is not
included. If you're using a script, we don't recommend that you include
the password since the password will be in clear text. Also, this is the
same password that is used for all accounts. |
/lae
| You can enable the local user accounts that are created with the /lae switch. You must include the /lac switch when using the /lae switch. |
4.2. Using the /auto Switch
You can use the /auto switch in the LoadState command the same way you can use it with the LoadState command. Table 9 shows the switches used with the following command:
C:/>c:/usmt/1oadstate /auto:c:/usmtX c:/USMTStore /l:my1oadstate.log /lac
Table 9. Using the LoadState /auto switch
Switch | Description |
---|
/auto | Using the /auto
switch without a directory path causes it to set the directory path to
the location where the U SMT files are installed (if they were installed
rather than just copied).
If you have local users to migrate, you must include at least the /lac switch. |
/auto:c:Xusmt | If you specify a path with the /auto switch, it will use this path to locate and use the MigDocs.xml and MigApp.xml files. |
5.3.4.3. Decrypting the Migration Store
If you encrypted the migration store with the ScanState tool, you'll need to decrypt it using the /decrypt switch. The following command will decrypt the store using the default encryption method with a password key of P@ssw0rd. The switches are explained in Table 10.
C:/>c:/usmt/1oadstate /auto:c:/usmt/ c:/USMTStore /1:my1oadstate.1og
/decrypt /key:P@ssw0rd
Table 10. LoadState decryption switches
Switch | Description |
---|
/decrypt | Decrypts
the migration store. If you specified the encryption algorithm when
creating the store, you need to include it when decrypting it.
You must specify either the /key or /keyfile option when decrypting the store to identify the correct password. |
/key:KeyString
/key:"my P@ssw0rd"
| Specifies the
decryption key. This is the same key used to encrypt the store. If the
encryption key has a space, it needs to be enclosed in quotes. |
/keyfile:FileName | Specifies the location and name of a TXT file containing the decryption key. |
4.4. Retrieving Data from a Hard-Link Migration
If you used the /hardlink switch to create a hard-link migration store, you can use the /hardlink switch with the LoadState command, as shown with the following command:
C:\>c:\usmt\loadstate /auto:c:\usmt\ /hardlink c:\HardLinkStore
/l:myscanstate.log /nocompress /lac
Table 11 shows the switches used with the /hardlink option. Notice that you must use the /nocompress switch when using the /hardlink switch.
Table 11. LoadState /hardlink and /nocompress switches
Switch | Description |
---|
/hardlink | Enables hard links for a noncompressed store. This is only used for PC refresh scenarios. |
/nocompress | Specifies that the migration store is not compressed. |
4.5. Retrieving Data from Windows.old
If you performed a refresh and the installation created the Windows.old folder, you can use ScanState and then LoadState to retrieve and then restore the data. The Windows.old file doesn't exist before you refresh the computer, so you don't execute the ScanState command before the installation. Instead, you execute both commands after the refresh with Windows 7 running on the system.
The following is a sample ScanState command that will retrieve the data from the Windows.old folder.
C:\c:>c:\usmt\scanstate c:\usmtstore /auto:c:\usmt\
/offlinewino1d:c:\windows.oldXwindows
/hardlink c:\HardLinkStore /l:myscanstate.log /nocompress
If you have EFS encrypted files in the Windows.old folder, you can add the /efs switch with this command:
C:\>c:\usmtXscanstate c:\usmtstore /auto:c:\usmt\
/off1inewino1d:c:\windows.o1d\windows
/hardlink c:\HardLinkStore /l:myscanstate.1og /nocompress /efs:hard1ink
You can then use this command to load the user state data:
c:\>c:\usmt\1oadstate c:\usmtstore /auto:c:\usmt\ /1ac /hard1ink /nocompress
Table 12 shows the switches used with the /offlinewinold option. Notice that you must include the path to Windows within Windows.old as Windows.old\windows.
Table 12. Offline Windows folder switches
Switch | Description |
---|
/offlinewino1d:<windows.o1d path>
/offlinewino1d:c:\windows.o1d\window
| This switch points to the location ofthe Windows.old foIder. Normally this is named Windows.old, but if there are multiple Windows.old folders, they are named as Windows.old.000, Windows.old.001, and so on. |
/nocompress
| Specifies that the migration store is not compressed. |