====== Transfer Windows 10 from HDD to SSD ======
===== Built in Recovery Image =====
This guide was written for a step-by-step help to transfer a Windows 10 Home Single Language installation on a 1TB HDD to a 960GB NVMe drive.
- Download and install [[https://www.easeus.com/partition-manager/epm-free.html|Partition Master]] and [[https://www.easeus.com/backup-software/tb-free.html|Todo Backup]] from EaseUS' website. I used the registered versions, but the free versions should work just fine.
- Run a backup of the source drive with a network or usb drive as destination media.
- Open Partition Master and **Clone System Drive**. The source drive has 5 partitions, EFI Boot, Reserved, Windows (system), Windows (data), and the Windows Recovery partition. Clone System Drive will only copy EFI Boot and Windows (system) partitions. If necessary, delete all partitions on the destination drive first.
- Once cloned, change the size of the new Windows (system) partition to the desired size, and **Copy Partition** Windows (data) and Windows Recovery. The size of the latter does not need to be identical, but I chose to move the partition to the end of the drive, as it was on the source drive. Allow Windows to assign a drive letter to the recovery partition.
- The new drive's boot information does not contain a correct link to the Windows Recovery partition. To fix this, we need to open a command line as administrator.
- Use the following commands to make Windows recognize the recovery image, and enable it:reagentc.exe /setreimage /path R:\Recovery\WindowsRE /target C:\Windows
reagentc.exe /enable
Note that the destionation path is mandatory, and must be \Recovery\WindowsRE.
- Check that the image has been recognized. Remove the drive letter for the recovery partition.reagentc.exe /info
- Create a USB recovery drive, in case your SSD becomes inaccessible. Here is [[https://www.howtogeek.com/131907/how-to-create-and-use-a-recovery-drive-or-system-repair-disc-in-windows-8/|how to]].
===== Custom Recovery Image =====
- Alternatively, you can also create a new recovery partition from the running system. Run:dism /capture-image /imagefile:X:\install.wim /capturedir:C:\ /name:"Recovery" /compress:maximum
and save the image to an external drive X.
- Download the latest Windows 10 ISO image, any edition. Mount it as a virtual DVD (double click, or right click and select Mount), copy its contents to your new Recovery partition. Browse to the Sources folder on your new Recovery drive, and delete the install.esd or install.wim file (only one of these will be present). Copy the captured custom install.wim file to this folder to replace the ESD or WIM file you just deleted (Recovery drive, Sources folder).
- Create a batch file with all commands to build a custom recovery partition from the Windows 10 ISO image:bcdedit /create {ramdiskoptions} /d "Ramdisk"
bcdedit /set {ramdiskoptions} ramdisksdidevice partition=F:
bcdedit /set {ramdiskoptions} ramdisksdipath \boot\boot.sdi
for /f "tokens=2 delims={}" %%i in ('bcdedit.exe /create /d "Recovery" /application OSLOADER') do (set guid={%%i})
bcdedit /set %guid% device ramdisk=[F:]\sources\boot.wim,{ramdiskoptions}
bcdedit /set %guid% path \windows\system32\winload.efi
bcdedit /set %guid% osdevice ramdisk=[F:]\sources\boot.wim,{ramdiskoptions}
bcdedit /set %guid% systemroot \windows
bcdedit /set %guid% winpe yes
bcdedit /set %guid% detecthal yes
bcdedit /displayorder %guid% /addlast
- Execute the batch file from an elevated command line prompt.
* [[https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/windows-recovery-environment--windows-re--technical-reference#span-identrypointsintowinrespanspan-identrypointsintowinrespanspan-identrypointsintowinrespanentry-points-into-winre|Windows Recovery Environment (Windows RE)]]
* [[https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/bcdedit-command-line-options|BCDEdit Command-Line Options]]
* [[https://win10.guru/create-a-custom-windows-10-factory-recovery-partition/|Create a custom Windows 10 “factory recovery” partition]]
* [[https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-7/dd744280(v=ws.10)|Deploy a System Recovery Image]]