As many other companies, we are at the stage when we are almost ready to migrate our client PCs and end users to Windows 7.
In this short article I will try to explain why we decided to use USMT to achieve the desired result.
Tools and resources
I assume that you know what USMT is and understand how to use it and it’s limitations.
If this is the first time you hear about USMT, I strongly recommend referring to Microsoft TechNet first.
Below are the tools and resources I found very helpful while working with USMT
USMT 4 TechNet resources
http://technet.microsoft.com/en-us/library/dd560801%28WS.10%29.aspx
http://technet.microsoft.com/en-us/library/dd560781%28WS.10%29.aspx
USMT 4 for Windows 7 and Server 2008 R2
USMT is installed as part of WAIK installation; get the latest version from Microsoft here
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34
You need to download the file KB3AIK_EN.iso
USMT XML Builder
http://www.wintools.com.au/usmtgui.php
You can get the trial version; it will help you to understand the logic of USMT configuration files.
This product has tendency to mess things up, always check the final file manually.
And of course your best friend is always
www.google.com
USMT or PC Transplant?
After looking at both we have decided to go with USMT as it was more flexible for our needs.
But the choice is yours and I would recommend looking at different tools, before making the final decision.
Migrate Or Not To Migrate?
Before you start migration you need to decide what exactly do you want to migrate:
- Are you just changing the OS and keeping application the same?
- Are you changing the OS and applications?
- What data do you want to migrate?
- Who is backing up users’ local files: users themselves or administrators?
Below is the example of our migration scenario.
FROM TO
Windows XP Pro SP3
Office 2003 Pro
Microsoft IE7 and secure certificates
Mozilla Firefox 3.x
Approved custom applications
Not approved applications
Various development applications and tools
Personal data in various locations
hosts and lmhost files
|
Windows 7 Ent 32
Office 2010 Pro Plus
Microsoft IE8
Mozilla Firefox 3.6.12 (or latest)
Approved custom applications
Not approved applications
Various development applications and tools
Personal data in various locations
hosts and lmhost files
|
After testing and debating what and how we will migrate we have decided the following:
· Office 2003 to Office 2010
There is no migration path, but we can preserve .nk2 files (recently typed e-mails cash) and then convert them to Office 2010 format (this will be a manual task)
· Microsoft IE7 to Microsoft IE8
We need to migrate the favorites and any certificates.
Favorites are just a folder, but certificates will have to be backed up/ restored by the user manually. Communication with detailed instructions will need to be sent to users.
· Mozilla Firefox 3.x
Firefox does not migrate very well, too many variables and custom features.
We have decided that users will have to backup/ restore Firefox favorites manually. Communication with detailed instructions will need to be sent to users.
As a precaution we are capturing .json files (this is a latest auto backup of Firefox updates).
· Standard set of applications/ Not approved applications
We have tested all approved applications with Windows 7 and they all work. If users have not standard applications installed on their XP machines we will look at them on individual basis.
· Development tools and applications.
This is the biggest “show stopper” for any migration, as many development tools need to be installed by the user and require custom configuration during installation.
We are still debating the best approach, but looks like we may go with the separate image for the developers with all the applications they need preinstalled and configured.
· Personal Data
We have decided to migrate:
o All desktop items
o My document items (local only, not offline my docs)
o All data from C:\ drive, apart from temp and system files and folders (see exclusions in miguser.xml)
· hosts and lmhost files
we are migrating these files across to Windows 7 with the source files as priority
USMT Shared Folder
The following is the simplified configuration example and you can easily modify it to your needs.
You need to create the shared folder for USMT.
You can create folder like one below on your Deployment Server and then share it.
D:\USMTDATA\
USMT\
captures\ - you need to create this folder
x86\ - this folder is copied from USMT installation on your PC
(\Program Files\Windows AIK\Tools\USMT)
All .xml files go there also.
Share it something like USMTDATA$
Configuring and using USMT
USMT will scan source Computer and save findings into the flat file, then when it is run on the target Computer it will restore captured data. Example commands are below.
You need to run ether locally or from the network
USMT Scan State
d:\usmtdata\usmt\x86\Scanstate.exe /i:d:\usmtdata\usmt\x86\miguser.xml d:\ usmtdata\usmt\captures\%computername% /uel:30 /ui:<domain name>\*
USMT Load State
d:\usmtdata\usmt\x86\Loadstate.exe d:\ usmtdata\usmt\captures\%computername% /i:d:\ usmtdata\usmt\x86\miguser.xml
Scanstate switches explained
miguser.xml – configuration file for what is captured and restored.
%computername% - tells USMT to use PC’s NetBIOS name for the folder name
Please note that switches below cannot be used with /all (explicitly migrate all users)
/ui:<domain name>\* - specifies domain and user name
If you have users from different domains login to the same computer and want to migrate all of them use this, it will also migrate all local users
ui:*\*
To only migrate domain and exclude all local users use
/ue:* /ui:DomainName\*
/uel:30 – will only capture users accounts if user logged in the last 30 days, or whose accounts have been otherwise modified on this computer.
Unfortunately this option does not work with /ue: commands.
If you use uel:<number of days> it will disregard any /ue: commands
So you can use
/uel:30 /ui:DomainName\* - this will capture all local and DomainName users who have logged on, or whose accounts have been otherwise modified on this computer.
OR
/ue: /ui:DomainName\* - this will ignore all local accounts and capture only domain accounts
The following will still capture all active in 30 days users: domain and loca
/ue:* /uel:30 /ui:DomainName\*
So, you can either exclude some accounts OR exclude account with no activity in last number of days, but you cannot have both when running scanstate.
However, you can exclude local user accounts when running loadstate with the switch
/ue:%computername%\*
So please take this in to account when planning for the USMT files storage.
Run USMT directly from shared drive
You can map USMTDATA$ share to the client computer and run usmt from the share.
Use the script below to do it (modify it for loadstate accordingly).
If you run it from the Deployment Server %DSSERVER% will be automatically replaced by the DS name
REM Migrate All users active in last 30 days
set server=%DSSERVER%.YOURDOMAIN.com
set share=usmtdata$
set drive=w:
set domain=YOURDOMAIN.com
set user=USERNAME - user that has access to USMT share
set password=above USER password
net use %drive% \\%server%\%share% %password% /user:%domain%\%user% /persistent:no
REM USMT Capture
%drive%\USMT\x86\scanstate.exe /i:%drive%\USMT\x86\miguser.xml %drive%\USMT\captures\%computername% /uel:30 /ui:YOURDOMAIN\*
REM Disconnect drive
net use %drive% /delete
Configure custom miguser.xml
We are using only one configuration file for USMT: miguser.xml, so I will explain what changes we have done to it.
Both files are attached: miguser-orig.xml and miguser.xml
Default miguser-orig.xml
If you look at the default miguser-orig.xml file you will see that USMT is capturing:
· users’ data inside each user profile
· standard shared data
· searches local disks for particular file types outside user profiles folder.
It will capture the following
<!-- This component migrates My Video files -->
<!-- This component migrates Shared Video files -->
<!-- This component migrates My Music files -->
<!-- This component migrates Shared Music files -->
<!-- This component migrates Desktop files -->
<!-- This component migrates Shared Desktop files -->
<!-- This component migrates Start Menu files -->
<!-- This component migrates Shared Start Menu files -->
<!-- This component migrates My Documents files -->
<!-- This component migrates Shared My Documents files -->
<!-- This component migrates My Pictures files -->
<!-- This component migrates Shared Pictures files -->
<!-- This component migrates Favorites -->
<!-- This component migrates Shared Favorites -->
<!-- This component migrates Quick Launch files -->
<!-- This component migrates user files with known extension-->
Following folders are excluded:
\Program Files\*
\Windows\*
Default miguser-orig.xml will work quite well and capture a lot of data, but we did not like that it transferred some not needed data and didn’t capture files which extensions that are not listed. It also transferred Start Menus, but because we are deploying different applications they are not relevant.
So, to fix the issue we did some modification to themiguser.xml.
· We are not transferring
<!-- This component migrates Start Menu files -->
<!-- This component migrates Shared Start Menu files -->
This is done by just deleting actual section from the xml file
· We are not searching for files by extensions, but capture all files and just exclude particular folders.
· We are also capturing .nk2 and .json files in each user profile and restore them onto user’s desktop in Windows 7 to MD folder.
To change what files we capture and what data to exclude we changed the following section in miguser.xml. This is the actual code and you can use it.
We have replaced default
<!-- This component migrates user files with known extension-->
With modified
<!-- This component Migrates all files from local disks including subfolders-->
<component type="Documents" context="UserAndSystem">
<displayName _locID="miguser.userdata">User Data</displayName>
<role role="Data">
<rules context="User">
<include>
<objectSet>
<pattern type="File">C:\* [*]</pattern>
<pattern type="File">%CSIDL_APPDATA%\Microsoft\Outlook\ [*.NK2]</pattern>
<pattern type="File">%CSIDL_SYSTEM%\drivers\etc\ [hosts]</pattern>
<pattern type="File">%CSIDL_SYSTEM%\drivers\etc [lmhosts]</pattern>
<pattern type="File">%CSIDL_APPDATA%\Mozilla\*\bookmarkbackups\ [*.json]</pattern>
</objectSet>
</include>
<exclude>
<objectSet>
<pattern type="File">C:\temp\* [*]</pattern>
<pattern type="File">C:\SwSetup\* [*]</pattern>
<pattern type="File">C:\Quarantine\* [*]</pattern>
<pattern type="File">C:\RECYCLER\* [*]</pattern>
<pattern type="File">C:\System Volume Information\* [*]</pattern>
<pattern type="File">C:\CorporateImages\* [*]</pattern>
<pattern type="File">C:\Config.Msi\* [*]</pattern>
<pattern type="File">%PROFILESFOLDER%\* [*]</pattern>
<pattern type="File">%CSIDL_WINDOWS%\* [*]</pattern>
<pattern type="File">%CSIDL_PROGRAM_FILES%\* [*]</pattern>
<pattern type="File">C:\ [*.bat]</pattern>
<pattern type="File">C:\ [*.cfg]</pattern>
<pattern type="File">C:\ [*.com]</pattern>
<pattern type="File">C:\ [*.dat]</pattern>
<pattern type="File">C:\ [*.dll]</pattern>
<pattern type="File">C:\ [*.ini]</pattern>
<pattern type="File">C:\ [*.sys]</pattern>
<pattern type="File">C:\ [*.log]</pattern>
<pattern type="File">C:\ [ntldr]</pattern>
</objectSet>
</exclude>
<locationModify script="MigXmlHelper.Move('%CSIDL_DESKTOPDIRECTORY%\MD\')">
<objectSet>
<pattern type="File">%CSIDL_APPDATA%\Microsoft\Outlook\ [*.NK2]</pattern>
<pattern type="File">%CSIDL_APPDATA%\Mozilla\*\bookmarkbackups\ [*.json]</pattern>
</objectSet>
</locationModify>
<merge script="MigXmlHelper.SourcePriority()">
<objectSet>
<pattern type="File">%CSIDL_SYSTEM%\drivers\etc\ [hosts]</pattern>
<pattern type="File">%CSIDL_SYSTEM%\drivers\etc [lmhosts]</pattern>
</objectSet>
</merge>
</rules>
</role>
</component>
All you need to do now is to run script to capture data, deploy new OS and run script to restore data back into the new OS environment.
If you have any questions please ask.
Andrey Shipov
IS Infrastructure Senior Engineer
Manchester, UK