Fast & Free: Desktop Data Migration Using USMT Brad Engle Janet Keener

advertisement
Fast & Free: Desktop Data
Migration Using USMT
Brad Engle
Janet Keener
Year 1 – 487 units
• Imaged at the desktop with DVDs, vendorsupplied migration utility. No consistency.
Captured music brought from home. Learned
a lesson from that.
Years 2-5
• Imaged at the factory now. Still using vendorsupplied migration utility, still no consistency.
Year 6
• Still imaging at factory, but they have a new
utility. Slow, inconsistent, cumbersome, no
real-time, on-the-fly edits to the script.
Year 7
• Things changed…
Year 7
• Factory imaging, but vendor has NO utility
that would migrate from XP to Windows 7.
History
•
•
•
•
•
Year 1 - 487 units
Year 2 - 415 units
Year 3 - 317 units
Year 4 - 142 units
Year 9 - ~470 units
Year 5 - 511
Year 6 - 445
Year 7 - 351
Year 8 - 128
What changed?
Janet says:
• Where did the idea come from?
– Necessity – no cost-effective 3rd party utility
– Current vendor had no solution
Brads says:
• Boss said, “Figure it out! You have 2 weeks.”
• Primary idea came from TechNet, using
“Windows Automated Installation Kit (AIK) for
Windows 7”
How we began
• Research, research, research
• Reviewed Altiris, Norton Ghost Console, some
freeware applications. NONE were costeffective, all were complex or lacked features
• USMT kept appearing in white papers
• Primary idea came from TechNet
• v 4.0 Included for free with The Windows
Automated Installation Kit (AIK) for Windows
7 (We had been using it since it came out but
was not aware of this feature)
• Was a straight forward, easily modified
solution that was controlled by a few xml files
The Files
•
•
•
•
•
Config.xml
MigApp.xml
MigUser.xml
MigDocs.xml
Custom.xml
• Config.xml
• Created by running scanstate.exe /genconfig
on the source PC
• Used to control what system settings are
copied from the old computer to the new
computer
• Must ensure that all apps are installed so
genconfig can create a complete inventory
Config.xml
<?xml version="1.0" encoding="UTF-8" ?>
- <Configuration>
<Applications />
<Documents />
- <WindowsComponents>
- <component displayname="gadgets" migrate="no" ID="gadgets">
<component displayname="gadgets\sticky notes" migrate="no" ID="gadgets\sticky notes" />
</component>
<component displayname="WCF-NonHTTP-Activation" migrate="no" ID="http://www.microsoft.com/migration/1.0/migxmlext/cmi/wcf-nonhttpactivation/wcf-nonhttp-activation/settings"/>
<component displayname="TSPortalWebPart" migrate="no"
ID="http://www.microsoft.com/migration/1.0/migxmlext/cmi/tsportalwebpart/tsportalwebpart/settings" />
<component displayname="WCF-HTTP-Activation" migrate="no" ID="http://www.microsoft.com/migration/1.0/migxmlext/cmi/wcf-httpactivation/wcf-http-activation/settings" />
<component displayname="WindowsSearchEngine" migrate="no"
ID="http://www.microsoft.com/migration/1.0/migxmlext/cmi/windowssearchengine/windowssearchengine/settings" />
<component displayname="Microsoft-Windows-themecpl" migrate="no" ID="http://www.microsoft.com/migration/1.0/migxmlext/cmi/microsoftwindows-themecpl/microsoft-windowsthemecpl/settings" />
- <component displayname="Tablet PC Settings" migrate="no" ID="tablet_pc_settings">
- <component displayname="Accessories" migrate="no" ID="tablet_pc_settings\tablet_pc_accessories">
<component displayname="Microsoft-Windows-TabletPC-Journal" migrate="no"
ID="http://www.microsoft.com/migration/1.0/migxmlext/cmi/microsoft-windows-tabletpc-journal/microsoft-windows-tabletpcjournal/settings" />
</component>
- <component displayname="Input Panel" migrate="no" ID="tablet_pc_settings\tablet_pc_input_panel">
<component displayname="Microsoft-Windows-TabletPC-InputPanel" migrate="no"
ID="http://www.microsoft.com/migration/1.0/migxmlext/cmi/microsoft-windows-tabletpc-inputpanel/microsoft-windows-tabletpcinputpanel/settings" />
</component>
• With all the No, then why have the file?
• Only place to have error control, hardlink
control, and profile control
Error Control
• USMT will fail on:
– locked or corrupt files
– locked or corrupt registry keys
• Can be overridden by specifying win32 error
codes in the <errorcontrol> section
<ErrorControl>
<fileError>
<nonFatal errorCode="33">* [*]</nonFatal>
<fatal errorCode="any">C:\Users\* *]</fatal>
</fileError>
<registryError>
<nonFatal errorCode="5">* [*]</nonFatal>
</registryError>
</ErrorControl>
• Hardlink control - used for keeping a profile on
the local hard drive when an in-place refresh
or upgrade is performed
• Profile control - when unpacking the profile
you can change permissions, change domains,
etc.
• miguser.xml - define folders, files and file
types to migrate. Essentially the “profile”
copy
• By default it will copy everything in the user’s
profile as well as files with a specified
extension
• Extensions copied by default:
.qdf, .qsd, .qel, .qph, .doc*, .dot*, .rtf,
.mcw, .wps, .scd, .wri, .wpd, .xl*, .csv, .iqy,
.dqy, .oqy, .rqy, .wk*, .wq1, .slk, .dif, .ppt*,
.pps*, .pot*, .sh3, .ch3, .pre, .ppa, .txt,
.pst, .one*, .vl*, .vsd, .mpp, .or6, .accdb,
.mdb, .pub
<component type="Documents" context="System">
<displayName _locID="miguser.userdata">User Data</displayName>
<role role="Data">
<rules>
<include>
<objectSet>
<script>MigXmlHelper.GenerateDrivePatterns ("* [*.qdf]", "Fixed")</script>
<script>MigXmlHelper.GenerateDrivePatterns ("* [*.qsd]", "Fixed")</script>
component type="Documents" context="User">
<displayName _locID="miguser.desktop">Desktop</displayName>
<paths>
<path type="File">%CSIDL_DESKTOP%</path>
</paths>
<role role="Settings">
<detects>
<detect>
<condition>MigXmlHelper.DoesObjectExist("File","%CSIDL_DESKTOP%")</condition>
</detect>
</detects>
<rules>
<include filter='MigXmlHelper.IgnoreIrrelevantLinks()'>
<objectSet>
<pattern type="File">%CSIDL_DESKTOP%\* [*]</pattern>
</objectSet>
</include>
<merge script="MigXmlHelper.DestinationPriority()">
<objectSet>
<pattern type="File">%CSIDL_DESKTOP% [desktop.ini]</pattern>
<pattern type="File">%CSIDL_DESKTOP%\* [*]</pattern>
</objectSet>
</merge>
</rules>
</role>
</component>
• MigDocs.xml – Very similar to the
miguser.xml. Only real difference is it migrates
shared files
• Important – Do NOT use the MigDocs.xml and
the MigUser.xml at the same time
custom.xml
• Allows any files not covered in the other xml
files to be copied
• Can copy registry keys, files, settings
• Can use Mutual Exclude commands
– Mutual Excludes transcend all xml files and cannot
be negated. This is the only value that has this
power
custom.xml
EXCLUDES Code sample:
<displayName>Deny</displayName>
<role role="Data">
<rules>
<unconditionalExclude>
<objectSet>
<script>MigXmlHelper.GenerateDrivePatterns ("* [*.divx]", "Fixed")</script>
<script>MigXmlHelper.GenerateDrivePatterns ("* [*.zip]", "Fixed")</script>
<script>MigXmlHelper.GenerateDrivePatterns ("* [*.exe]", "Fixed")</script>
<script>MigXmlHelper.GenerateDrivePatterns ("* [*.msi]", "Fixed")</script>
<script>MigXmlHelper.GenerateDrivePatterns ("* [*.iso]", "Fixed")</script>…
custom. xml
INCLUDE CODE SAMPLE:
<role role="Data">
<rules>
<include>
<objectSet>
pattern type="File">c:\*[*]</pattern>
<script>MigXmlHelper.GenerateDrivePatterns ("* [*.dic]", "Fixed")</script>
<script>MigXmlHelper.GenerateDrivePatterns ("* [*.pst]", "Fixed")</script>
<script>MigXmlHelper.GenerateDrivePatterns ("* [*.nk2]", "Fixed")</script>
</objectSet>
</include>
Scanstate
• Scanstate is the command line that actually
launches USMT to do the migration.
Scanstate Switches
• Some helpful switches:
– /ui: user to be migrated. I wrote it to supply the
primary user. You can specify all users, currently
logged in, etc. Very powerful
– /ue: excludes specified users
– /efs: decrypts files & moves them to TARGET
system
Scanstate Switches
– /localonly: DO NOT go scan all those huge
network drives!
– /config: specifies that you have a configuration file
to use.
– /i: an include statement that says you have
additional XML files to control the behavior of the
migration.
– /o: overwrites any existing data on the target
drive.
Execution
• set /p name= Machine name?
• set /p user= Username?
• del /q/f c:\oitdriver
• scanstate \\etsu%name%\c$\migration\mystore /vsc
/ue:*\*/ui:etsu\%user% /efs:decryptcopy /localonly
/config:config.xml /i:miguser.xml /i:custom.xml /v:13
/l:scan.log /o /listfiles:c:\temp\copylist.txt
Compression
• In our experiences, we’ve seen about a 2:1
compression ratio. If the utility packaged 4
GB, it would transfer about 2 GB. That’s what
Microsoft says, too.
Unpack the .mig file
• On TARGET machine, just run usmt.mig file
created by the process.
• The Easy Transfer Wizard included in Windows
7 begins, and the data is unpackaged to the
appropriate location on the new drive.
• Example – 1.7 GB packaged up. .88GB
transferred in about 4 minutes. Easy Transfer
complete unpacking in about 3 minutes.
FAST!
Yippee
• Even if the user’s account has never logged
into the TARGET system, this utility will
generate the profile and place the files
appropriately. 
• If you get an error 36, running the mig.bat file,
the profile on the SOURCE system is corrupt.

Next, we hope to…
• Explore the restorestate command & options,
and how that can be integrated into drive
imaging/re-imaging.
• Research Error code 36 and ways to overcome
that (temp profile being migrated)
Questions?
Comments?
brad@etsu.edu
janet@etsu.edu
www.etsu.edu\oit\userservices\fcf2011.pptx
Download