Info Successfully transferred a Windows install from one disk to another without disk cloning (WIM)

mikeymikec

Lifer
May 19, 2011
20,528
15,352
136
I have a bit of a problem, and my experiment today gets me a (AFAIK fairly definitive) step further towards fixing said problem.

Last year, I had the bright idea of using Windows's own disk mirroring system (disk management > dynamic disk > add mirror) as per Microsoft's instructions for two installs of Windows and it turns out that Microsoft has basically let this feature die through neglect so don't bother using it on Windows Server (tried it on 2022) or Windows 11*.

Both installs of Windows are 'live' and I have no desire to re-do either Windows install from scratch, so I've been looking for a way of taking the Windows data without the partitioning structure (dynamic disks have extra partitions and weird rules like dynamic disks can't be converted back to basic/normal disks without wiping first).

A quick google suggested that I should be thinking about doing a system state backup on Windows, then a bit more googling suggests that a system state backup function doesn't exist on client versions of Windows, so as I had already started a test install of Win10 Pro (1803) with a couple of spare disks with a dynamic disk mirror setup, I worked on the client problem first. Through Control Panel > Backup & Restore (Windows 7) I did a 'system image' backup, basically ticking everything it had to offer. I then switched off the machine, disconnected SSDs 1 & 2 with that install on and connected SSD3 (blank). Basically no combination I could conceive of would restore that system image onto SSD 3 (I wonder if this is because it was trying to do the mirror config or whatever other reason that I've never had system image restore work for me).

As I was staring at the recovery/setup environment command prompt, I remembered that I've done a lot of playing with recovery wim files and wondered if I could capture the guts of the Windows install in a wim file and apply that image to SSD3.

I was kinda loathe to follow another Microsoft guide as a Microsoft guide was partly responsible for landing me in this fix in the first place, but here's the one I followed:

In case Microsoft re-arranges their website, here's a brief version:

Starting position being a working Windows install.
Boot from setup media, plug in an external drive to store the WIM file on.
Shift+F10 for a command prompt
Code:
Dism /Capture-Image /ImageFile:"D:\Images\Fabrikam.wim" /CaptureDir:C:\ /Name:Fabrikam

I then shut down the computer, disconnected SSDs 1 & 2, connected SSD 3, did a quick Windows install onto 3, rebooted back into setup, Shift+F10 again,, checked that C:\ is the location of the new Windows install and attempted to run this:

Code:
dism /Apply-Image /ImageFile:"D:\Images\Fabrikam.wim" /Index:1 /ApplyDir:C:\

(I didn't bother with the script MS talked about because this isn't a time-saving multi-imaging tactic for me, I just need that Windows install with as little baggage as possible)

Which promptly threw "Access denied" errors. Admin command prompt? Access denied? Jog on, MS.
I dug into X:\..... dism.log as the error instructed and found that what the problem was this EXTREMELY IMPORTANT <snort> folder:
"C:\program files\windowsapps"
In no mood to play around, I rmdir /s /q'd that folder and tried dism again. Access denied again.
This time: "C:\programdata\microsoft\windows\apprepository"
Same treatment again, dism image succeeded, rebooted with SSD3, all appears to be fine. The disk doesn't think it's dynamic, and the canary-coal-mine install of Office 2000 also appears to be working.

Footnote:
* - re dynamic disk mirroring - When doing another such Win11 setup, I discovered that it won't auto install feature updates nor could I get it to in-place upgrade to 24H2, and the WinSrv2022 install decided to mark the second disk as offline at some point (no idea when, one would think when Windows breaks a mirror it would be like AWOOGA AWOOGA, but no). It had intermittently thrown various warnings in the past about the setup in the event log but the word on the Internet was along the lines of "just ignore those".
 
Last edited: