How to copy a Windows installation
Filesystem based copy of Windows 2000 or XP
If you want to transfer a working Windows 2000 or XP installation to a new harddrive, the following method has proven reliable. After the process your system will boot into the new system as if nothing would have happened.
The outline of the process is as follows:
- We use Windows to partition your new harddrive and format the new Windows partition.
- We copy the whole content of your old Windows partition to the destination partition.
- We tweak the registry on the destination partition.
- We boot the destination partition.
- After the process your new Windows will be exactly the same as the old one (see notes below).
- Since we use Windows to partition the new drive we make sure the partition table is compatible.
- Since the copy is filesystem based, your new installation will automatically be defragmented.
- Your destination can be bigger (or even smaller) than the source one, without the need of using tools like ntfsresize afterwards.
- We only use builtin tools, except for scopy, which is part of the Windows NT Server Resource Kit.
- This guide assumes that you can connect a second harddrive to your ThinkPad, be it via USB, PCMCIA or a UltraBay harddrive adapter.
- Get scopy from here and place it on your old partition.
- Attach the new harddrive to your ThinkPad.
- Boot up your Windows installation.
- Open the Disk Management Interface and partition your new harddrive. Set the partition that your system should be copied to as active. Also assign a drive letter, we will assume it is T: .
- Format this partition as NTFS in long format. This is important, because else the boot sector will not be installed to that partition.
Open the command line interface (cmd.exe) and use xcopy or scopy to copy all files from your old partition to the new one. Lets assume, your old system is on C:. The scopy command would be:
- <path_to_scopy>\scopy.exe C:\*.* T:\ /a /o /s
The xcopy command would be:
- xcopy C:\*.* T:\ /O /X /E /H /K
The important element here is to preserves NTFS file attributes and access rights while copying. For more information on preserving rights with xcopy, see http://support.microsoft.com/kb/323007.
Wait patiently till the copy is finished. You can now open T: in your Windows explorer to check if things went well.
Adjusting drive letters
- After the copy finished, open regedit.
- Mark <tt>HKEY_USERS and select "Load Hive..." from the "File" menu. Open T:\WINDOWS\system32\config\SYSTEM.
- You will be promptet for a name for the new hive, you may use i.e. "TEMP". The new hive will be attached to HKEY_USERS.
- Expand HKEY_LOCAL_MACHINE\SYSTEM and select the MountedDevices key there.
- DoubleClick "\DosDevices\T:" and mark the whole binary value. Press to copy the value.
- Expand HKEY_USERS\TEMP and select the MountedDevices key there.
- DoubleClick "\DosDevices\C:" and mark the whole binary value. Press to replace it with the copied value.
- Mark HKEY_USERS\TEMP and select "Unload Hive..." from the "File" menu. Confirm the request.
- Close regedit.
- Shutdown Windows.
Some steps above can be made a bit simpler. Above you copied drive C: to T:, so boot the copied drive it must become C: and the source may become T: (thus simply switch the drive letters). Swapping the keys in "\DosDevices\" is easier than the above steps:
- select "\DosDevices\T:" and in the Edit menu, select Rename, then overtype the T: with a temporary name, like NewC:.
- select "\DosDevices\C:" and in the Edit menu, select Rename, then overtype the C: with T:.
- return to the previous key (where you entered the temporary name, "\DosDevices\newC:" in the example), select Rename once more in the Edit menu, and overtype the temporary name NewC: by C:.
Booting the new System
Now, replace your old internal harddrive with the new one and power up your system again. The new system should boot as if nothing happened.
- This article is based on information found on http://gamma.nic.fi/~point/win2copy.htm.