Windows 7 – Installation & Migration
Clean Installation Alternatives
Installing from DVD or USB drive ( See Making a bootable Windows 7 USB installation media )
Installing from a network share using WinPE ( Windows Preinstallation Environment )
Installing through WDS ( Windows Deployment Services )
- WDS uses multicasting which means that an installation media is only sent from a server once, and is simultaneously received by all receiving clients.
- WDS demands that the clients have a PXE compliant network card or booting up using a WDS discover image.
- WDS needs the install.wim file from the installation media and installations can be made unattended.
- The advantages of WDS are many, for example minimizing the data sent across the network compared for example WinPE network installations.
Dual boot installations require a separate partition or drive unless you use a virtual hard drive (VHD). VHD demands a Win7 or 2008 Server Boot environment so dualbooting a VHD Win7 on a Win XP boot environment is not possible. When performing a ordinary multi-partition dual / triple boot installation you install oldest OS first, newest last.
The default operating system and time before booting default OS in a dual boot system can be changed from Control Panel / Advanced System Settings / Advanced / Click settings in the Startup And Recovery Section.
Upgrading
Upgrading can be preferable in some ways. It is often cheaper than a clean install, though i doubt that it is common practice in larger corporations. Apart from upgrading using the installation media, Windows Anytime Upgrade can also be used to purchase and install an upgrade. When upgrading its recommended to use the Windows 7 upgrade advisor which can be downloaded from Microsoft.
A windows 7 upgrade from Vista will automatically be rolled back if failed. You can never upgrade between different x64 / x86 versions and you can only upgrade Vista to an equivalent or higher edition of Windows 7.
Migrating from Windows XP directly to Windows 7 is not possible. You will have to migrate / backup the user profiles and data either using side-by-side or wipe-and-load migrations.
Side-by-side: user profiles and data are moved from the old computer to a new computer.
Wipe-and-load: User profile and data are backup up, then wiping the computer, reinstalling and then importing the user data. Con: No failsafe if the migration goes wrong since the original XP installation is no more.
Migrating User Profiles & Data
A GUI tool to help migrate Profile information from one installation to another. Included in Windows 7, needs separate install for use with XP and Vista. Handy for single or few computer migrations. Working modes:
- Easy Transfer Cable: A special USB cable allowing direct migration between two computers. Naturally needs both computers physically present at same location and started. Which in turn means only side-by-side migrations.
- Network: Transfers data between the two computers via LAN connection. side-by-side only, as the method above.
- External or Flash drive: Used for Wipe-and-load migrations where you store the data temporarily on an external or USB flash drive.
USMT (User State Migration Tool)
Included in WAIK (Windows Automated Installation Kit), a commandline utility to extract and import User related information. Noteable Allow Notes: Can migration from 7 to Vista. Captures Account, files, O/S and application settings. Do not capture drivers, passwords, local printers or network drives. USMT uses preset rules that are store in the following files:
- MigApp.xml: Contain Application settings like odbc, Office, accessablility settings and so forth.
- MigUser.xml: Contain User Account settings like data folders, filetype includes and user profile settings.
- MigDocs.xml: Contain information on location of user files.
- Config.xml: Reverse in regard to the other, used for exclusion of features. Configured with /genconfig
USMT can be used to perform offline migrations as well when used from a Windows PE environment. Windows 7 only.
Image creation & deployment using WAIK
WAIK kan be used for several different tasks like creating custom PE images, creating unnattended install images and other stuff. WAIK contains the following tools:
- Windows SIM, used to open images, create answer filesmanage distribution shares and configuration sets
- ImageX, a tool to create and mount/modify/extract windows images (.wim files).
- DISM applies updates, drivers, language packs, applications etc to wim files.
- Win PE Tools, tools to build and configure winpe images
- USMT, tool to migrate user data from previous windows versions to windows 7.
- oscdimg, creates ISO images.
DISM
Replaces the Package Manager (pkgmgr.exe), PEImg and Intlcfg. Used to upgrade Windows editions, prepare winpe images, enabling or disabling win features in wim files, service o/s with service packs, use of package manager scripts.
Creating and manipulating WIM files
Making a Custom Windows PE Image
/*Generate WinPE template files*/ cd\Program Files\Windows AIK \Tools\PETools\copype.cmd x86 <Destination> /*Architecture: amd64, x86, ia64*/ /*Optional, create a WIMscript*/ /*Create a wimscript.ini file and place it in the same folder as the imagex utility.*/ /*Copy the winpe.wim in <Destination> folder to <Destination>\ISO\sources */ /*rename the file you just moved to boot.wim */ imagex /mountrw <Destination>\ISO\sources\boot.wim 1 <Destination>\mount /*Copy the imagex.exe file to <Destination>\mount\Windows\System32\ */ imagex /unmount /commit <Destination>\mount /*Building the ISO image*/ oscdimg -n -b<Destination>\etfsboot.com <Destination>\ISO <ISOpath>\winmpe_image.iso
Creating a custom installation image
Creating an answer file
- Copy the install.wim file from a windows install dvd, it is found in the \sources folder.
- Start Windows System Image Manager(Windows SIM) (shortcut is found in the start menu)
- From the file menu, select the copied win file (Select windows image). Choose yes when prompted to create a catalog file.
- Choose new answer file from the select menu.
- Set the desired properties (samples can be found in WAIK installation \samples folder) and click ‘Validate Answer File’ in the tools menu.
- Save the answerfile as ‘Autounattend.xml’ and place it where applicable
Building a Reference installation
- Install a windows 7 reference computer using a win7 install disc and, if choosen, the answerfile you created placed on a removable storage device.If only a small number of clients are requierd the aove step can just be repeated. Otherwise, see below:To prepare the reference installation, you need to run sysprep. This command prepares the installation for use on other machines.
- >sysprep.exe /oobe /generalize /shutdown
/oobe = removes the oobe settings, making it boot to windows welcome at next start. /generalize = removes hardware related information and settings from the reference installation.
- If certain, non default, drivers from the installation needs to be kept = Set PersistAllDeviceInstalls setting of the Microsoft-Windows-PnpSysPrep feature in the answerfile to True.
- Boot the computer using a WinPE iso / disc. If you do not have one, crate one according to steps above.
- When booted you again use the imagex command.
- You can either store the image you will create to a local disc or alternatively save it to a network share. If you like to use a network share, you should first map the drive: net use x: \ \<Share IP or DNS>\<Folder Name> /<User> <Pass>
- >imagex.exe /capture c: t:\os-image.wim "Test Win7 Install" /compress
Manipulating WIM files using DISM
DISM is a complex utility with many features, some matched by imagex. Below is some examples of DISM commands:
/*Getting wim file information.*/ dism /get-wiminfo /wimfile:<Path>\<FileName>.wim imagex /info <Path>\<FileName>.wim /*Gives more details than dism*/ /*mounting an image*/ dism /mount-wim /wimfile<Path>\<FileName>.wim /index:1 /mountdir:<PathToMountDir> imagex /mountrw <Path>\<FileName>.wim 1 <PathToMountDir> /*unmounting an image*/ dism /unmount-wim <PathToMountDir> imagex /unmount <PathToMountDir> /*Getting mount information*/ dism /get-mountedwiminfo /*Remove corrupt files from mounted image*/ dism /cleanup-wim
Restoring and deploying images
Deploying to a client using WinPE media
Boot into your WinPE media. This describes the procedure using a 100MB system partition.
diskpart /*Create system partition*/ select disk 0 clean /*if the disk contains data*/ create partition primary size=100 select partition 1 format fs=ntfs label="system" assign letter=c active /*Create Windows partition*/ create partition primary /*This allocates all remaining space*/ select partition 2 format fs=ntfs label="Windows" quick asssign letter=d exit /*Map the network share used for installation*/ net use t: \\<server>\<share> /user:<domain>\<user> * /*Restore the wim image to the drive*/ imagex /apply t:\mywimimage.wim 1 d: /*Recreating the system partition so the system can boot*/ bcdboot d:\Windows
Converting your VIM to a VHD file and use it in a Windows 7 multiboot setup
To do this you will need wim2vhd, a utility which helps us create a vhd file from our wim reference image.
/*Convert the WIM file to VHD.*/
cscript wim2vhd.wsf /wim:<Path>\<fileName>.wim /sku: <ostype> /vhd: <DestPath>\<FileName>.vhd
/*sku = o/s version, can be retrived using imagex analyze if uncertain*/
/*Above can be combined with /unattend:<Path>\unattend.xml if unattend file is to be used*/
/*If you want to set the vhd disk size the /size:20000 (20GB)*/
/*Select and attach the VHD drive*/
diskpart
select vdisk file=<Path>\<filename>.vhd
attach vdisk
assign letter=v
/*Note: How to create a VHD file and prepare it.*/
create vdisk file=<Path>\<filename>.vhd
select vdisk file=<Path>\<filename>.vhd
attach vdisk
create partition primary /*Or your preferred partitioning scheme*/
assign letter=x
format fs=ntfs quick label="VHD Partition"
exit
/*Add the appropriate boot entrys for the multiboot.*/
bcdedit /copy {current} /d "Boot to VHD"
/*Copy the guid shown after above command is run including {}*/
bcdedit /set <guid> device vhd=[DriveLetter:]\<Path>\<filename>.vhd
bcdedit /set <guid> osdevice vhd=[DriveLetter:]\<Path>\<filename>.vhd
bcdedit /set <guid> detecthal on
bcdedit /v /*Verifies and shows the boot option settings*/
/*Note: Delete boot option is made as below */
bcdedit /delete <guid> /cleanup
MDT
MDT 2010 is a toolkit for acceleration of o/s and application deployment. MDT can be used on imaging and deployment servers (can be run on a win7 client as well) to implement automatic deployment of win7 and other o/s. It offers standardized desktop and server images, guidance and job aids. LTI (Lite Touch Installation) is used to distribute images with small degree of user intervention and can be used when no other distribution tools exist. ZTI (Zero Touch Installation) requires no user intervention but needs SCM 2007 + deployment feature pack. Other utilities such as SQL Server are needed as well.
WDS
A lightweight alternative to MDT.WDS installs like any default windows server role and integrates into AD, but functions on a non ad domain server as well. Uses a pxe booted version of Windows PE. The WDS WIM image is booted over the network into a ramdisk. The installation is then handled through Win PE.
WDS uses 4 typs of images: Boot (winpe boot image used when installing), Install (the o/s image deployed to the client), Capture (the image used to capure the reference o/s ass WIM image) and Discover (used to boot the client when the client is not PXE enabled).
WDS images
The windows installation dvd contains a default wim file named boot.wim. This can be used (and typically are?) as the capture, boot and discover image. Since the install image is the image you will capture and deploy this will be created by yourself. WDSUTIL is the commandline utility to add these images to WDS(if not using GUI).
