https://www.thinkwiki.org/w/api.php?action=feedcontributions&user=Zaphodboy&feedformat=atomThinkWiki - User contributions [en]2024-03-29T12:31:37ZUser contributionsMediaWiki 1.31.12https://www.thinkwiki.org/w/index.php?title=How_to_copy_a_Windows_installation&diff=37367How to copy a Windows installation2008-04-20T14:06:08Z<p>Zaphodboy: added xcopy command</p>
<hr />
<div>{| width="100%"<br />
|style="vertical-align:top;padding-right:20px;width:10px;white-space:nowrap;" | __TOC__<br />
|style="vertical-align:top" |<br />
<div style="margin: 0; margin-right:10px; border: 1px solid #dfdfdf; padding: 0em 1em 1em 1em; background-color:#efefef; align:right;"><br />
This page provides assistance in seemlessly copying a working Windows installation to a new partition/harddrive, so that afterwards it seems like nothing has happened.<br />
</div><br />
|}<br />
==Filesystem based copy of Windows 2000 or XP==<br />
{{WARN|If you follow these instructions, you do it on your own risk. Even though this process was successfully executed at least once, no success is guaranteed and data loss can happen. Since no modification to your old harddisk is done, data loss is unlikely. However, it is possible.}}<br />
<br />
{{NOTE|A similar process, however, involving a (temporary) second Windows installation has proven to be reliable. It is safer to do the copy from a second Windows installation since then the running system doesn't interfere with the files copied. The steps needed in this case are very similar.<br />
}}<br />
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.<br />
<br />
===The Process===<br />
The outline of the process is as follows:<br />
#We use Windows to partition your new harddrive and format the new Windows partition.<br />
#We copy the whole content of your old Windows partition to the destination partition.<br />
#We tweak the registry on the destination partition.<br />
#We boot the destination partition.<br />
<br />
===The Advantages===<br />
*After the process your new Windows will be exactly the same as the old one (see notes below).<br />
*Since we use Windows to partition the new drive we make sure the partition table is compatible.<br />
*Since the copy is filesystem based, your new installation will automatically be defragmented.<br />
*Your destination can be bigger (or even smaller) than the source one, without the need of using tools like ntfsresize afterwards.<br />
*We only use builtin tools, except for scopy, which is part of the Windows NT Server Resource Kit.<br />
<br />
===Prerequsites===<br />
*This guide assumes that you can connect a second harddrive to your ThinkPad, be it via USB, [[PCMCIA]] or a [[UltraBay]] harddrive adapter.<br />
*Get scopy from [http://gamma.nic.fi/~point/files/scopy.exe here] and place it on your old partition.<br />
<br />
===Preparation===<br />
*Attach the new harddrive to your ThinkPad.<br />
*Boot up your Windows installation.<br />
*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 {{path|T:}} .<br />
*Format this partition as NTFS in long format. This is important, because else the boot sector will not be installed to that partition.<br />
<br />
===Copying===<br />
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 {{path|C:}}. The scopy command would be:<br />
:<tt><path_to_scopy>\scopy.exe C:\*.* T:\ /a /o /s</tt><br />
The xcopy command would be:<br />
:<tt>xcopy C:\*.* T:\ /O /X /E /H /K<br />
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.<br />
<br />
Wait patiently till the copy is finished. You can now open T: in your Windows explorer to check if things went well.<br />
<br />
===Adjusting drive letters===<br />
*After the copy finished, open regedit.<br />
*Mark <tt>HKEY_USERS</tt> and select "Load Hive..." from the "File" menu. Open {{path|T:\WINDOWS\system32\config\SYSTEM}}.<br />
*You will be promptet for a name for the new hive, you may use i.e. "TEMP". The new hive will be attached to <tt>HKEY_USERS</tt>.<br />
*Expand <tt>HKEY_LOCAL_MACHINE\SYSTEM</tt> and select the <tt>MountedDevices</tt> key there.<br />
*DoubleClick <tt>"\DosDevices\T:"</tt> and mark the whole binary value. Press {{key|Ctrl}}{{key|C}} to copy the value.<br />
*Expand <tt>HKEY_USERS\TEMP</tt> and select the <tt>MountedDevices</tt> key there.<br />
*DoubleClick <tt>"\DosDevices\C:"</tt> and mark the whole binary value. Press {{key|Ctrl}}{{key|V}} to replace it with the copied value.<br />
*Mark <tt>HKEY_USERS\TEMP</tt> and select "Unload Hive..." from the "File" menu. Confirm the request.<br />
*Close regedit.<br />
*Shutdown Windows.<br />
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 <tt>"\DosDevices\"</tt> is easier than the above steps:<br />
* select <tt>"\DosDevices\T:"</tt> and in the Edit menu, select <tt>Rename</tt>, then overtype the <tt>T:</tt> with a temporary name, like <tt>NewC:</tt>.<br />
* select <tt>"\DosDevices\C:"</tt> and in the Edit menu, select <tt>Rename</tt>, then overtype the <tt>C:</tt> with <tt>T:</tt>.<br />
* return to the previous key (where you entered the temporary name, <tt>"\DosDevices\newC:"</tt> in the example), select <tt>Rename</tt> once more in the Edit menu, and overtype the temporary name <tt>NewC:</tt> by <tt>C:</tt>.<br />
<br />
===Booting the new System===<br />
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.<br />
<br />
===External Sources===<br />
*This article is based on information found on http://gamma.nic.fi/~point/win2copy.htm.<br />
<br />
[[Category:Windows]]</div>Zaphodboy