Solved W7 Registry backup app that uses Shadow Copy?

teckneeculler

Member
Power User
VIP
Local time
8:35 PM
Messages
512
I've recently discovered that not all Registry Backup apps might be equal. Apparently some use Microsoft's Shadow Copy for the process while some don't, meaning that such backups don't include the sections of the Registry that are in use when the backup is created.
Can anyone confirm this? And perhaps suggest which apps are the Shadow Copy type?
 

My Computer My Computer

At a glance

Win7 Ultimate SP1Intel Core i5 9400 Coffee Lake 14nm16G DDR4NVidia GeForce GTX 960
Computer type
PC/Desktop
Computer Manufacturer/Model Number
My build
OS
Win7 Ultimate SP1
CPU
Intel Core i5 9400 Coffee Lake 14nm
Motherboard
Asus Prime H310M-E R2.0 (LGA1151)
Memory
16G DDR4
Graphics Card(s)
NVidia GeForce GTX 960
Sound Card
Realtek High Definition Audio (mobo)
Monitor(s) Displays
Asus PA248 24" 16:10 format
Screen Resolution
1920x1200@59Hz
Hard Drives
1863GB Seagate ST2000DM
3726GB Seagate ST4000DM
1863GB Seagate ST2000DM
6TB Seagate
465GB NVMe Samsung SSD 970
PSU
750G2
Case
Tower
Cooling
Standard
Keyboard
USB
Mouse
USB
Internet Speed
920Mbs/480Mbs
Antivirus
Malwarebytes
Browser
Firefox

My Computers My Computers

  • At a glance

    7 X64i5 84002x8gb 3200mhz
    Computer type
    PC/Desktop
    OS
    7 X64
    CPU
    i5 8400
    Motherboard
    gigabyte b365m ds3h
    Memory
    2x8gb 3200mhz
    Hard Drives
    various
    PSU
    pure power 11 400w cm
    Case
    Coolermaster
    Cooling
    cryorig m9i
  • At a glance

    7x64g54008gb ddr4 2400
    Computer type
    PC/Desktop
    OS
    7x64
    CPU
    g5400
    Motherboard
    ga b365m ds3h
    Memory
    8gb ddr4 2400
    PSU
    xfx pro 450w
Shadow copy seems the wrong tool here. Registry access doesn't have the same lock mechanism that files have, so the registry cannot be "in use" and prevented access like files can.
If a registry backup program claims that it uses shadow copy or that it cannot work because it's in use it means that what it really copies are the hive files that back the registry and aren't accessing the registry itself like the build-in "regedit" tool does. As such, the mere use of such a backup program may mean that the "backup" it does is in itself broken. I would just drop all such programs.
 

My Computer My Computer

At a glance

Windows 7 Ultimate x64Intel Core i7-740QM8 GB DDR3NVIDIA GeForce 330GT
Computer type
Laptop
Computer Manufacturer/Model Number
Toshiba Sattelite A665-S6092
OS
Windows 7 Ultimate x64
CPU
Intel Core i7-740QM
Memory
8 GB DDR3
Graphics Card(s)
NVIDIA GeForce 330GT
Screen Resolution
1366x768
Hard Drives
Samsung 840 SSD 500GB
1TB USB3 external HD
Cooling
Coolermaster Notepal U3 notebook cooling pad
Internet Speed
3mbps ASDL
Antivirus
ClamWin 0.98.7
Browser
Opera 12.17 x86 (main), Firefox 38 (sec), IE11 (last resort)
The point is to back up the hives.
 

My Computers My Computers

  • At a glance

    7 X64i5 84002x8gb 3200mhz
    Computer type
    PC/Desktop
    OS
    7 X64
    CPU
    i5 8400
    Motherboard
    gigabyte b365m ds3h
    Memory
    2x8gb 3200mhz
    Hard Drives
    various
    PSU
    pure power 11 400w cm
    Case
    Coolermaster
    Cooling
    cryorig m9i
  • At a glance

    7x64g54008gb ddr4 2400
    Computer type
    PC/Desktop
    OS
    7x64
    CPU
    g5400
    Motherboard
    ga b365m ds3h
    Memory
    8gb ddr4 2400
    PSU
    xfx pro 450w
The point is to back up the hives.
That could result in inconsistent copies of the files, as Windows is modifying them and can result in copying a broken file. Any tool that picks the registry files directly from the file system is, inherently, flawed in this way. Shadow copy could help, but up to some point as we don't know how the registry write process works exactly and Windows don't place any guarrantes on it.

The only way to get a consisten backup is to go though the registry API directly and read the whole thing from there. The result could even be a normal .reg file that you import back in case of problems, either in full or partially. Taking a backup this way also eliminates the problem of locks, since the registry API don't provide them, and in this case Windows itself ensures consistency of the data returned, which may or may not be flushed to disk.
 

My Computer My Computer

At a glance

Windows 7 Ultimate x64Intel Core i7-740QM8 GB DDR3NVIDIA GeForce 330GT
Computer type
Laptop
Computer Manufacturer/Model Number
Toshiba Sattelite A665-S6092
OS
Windows 7 Ultimate x64
CPU
Intel Core i7-740QM
Memory
8 GB DDR3
Graphics Card(s)
NVIDIA GeForce 330GT
Screen Resolution
1366x768
Hard Drives
Samsung 840 SSD 500GB
1TB USB3 external HD
Cooling
Coolermaster Notepal U3 notebook cooling pad
Internet Speed
3mbps ASDL
Antivirus
ClamWin 0.98.7
Browser
Opera 12.17 x86 (main), Firefox 38 (sec), IE11 (last resort)
Yes we know. It doesnt matter. For the purpose of backup and restore it works. It is what all well known programs use for imaging os. Millions of people do it every day.

We are not concerned here about the minute details of forensics..
 

My Computers My Computers

  • At a glance

    7 X64i5 84002x8gb 3200mhz
    Computer type
    PC/Desktop
    OS
    7 X64
    CPU
    i5 8400
    Motherboard
    gigabyte b365m ds3h
    Memory
    2x8gb 3200mhz
    Hard Drives
    various
    PSU
    pure power 11 400w cm
    Case
    Coolermaster
    Cooling
    cryorig m9i
  • At a glance

    7x64g54008gb ddr4 2400
    Computer type
    PC/Desktop
    OS
    7x64
    CPU
    g5400
    Motherboard
    ga b365m ds3h
    Memory
    8gb ddr4 2400
    PSU
    xfx pro 450w
Thanks for the tip SIW2.
Perhaps Alejandro would explain exactly how he would go about backing up, and restoring, the W7 Registry.
 
Last edited:

My Computer My Computer

At a glance

Win7 Ultimate SP1Intel Core i5 9400 Coffee Lake 14nm16G DDR4NVidia GeForce GTX 960
Computer type
PC/Desktop
Computer Manufacturer/Model Number
My build
OS
Win7 Ultimate SP1
CPU
Intel Core i5 9400 Coffee Lake 14nm
Motherboard
Asus Prime H310M-E R2.0 (LGA1151)
Memory
16G DDR4
Graphics Card(s)
NVidia GeForce GTX 960
Sound Card
Realtek High Definition Audio (mobo)
Monitor(s) Displays
Asus PA248 24" 16:10 format
Screen Resolution
1920x1200@59Hz
Hard Drives
1863GB Seagate ST2000DM
3726GB Seagate ST4000DM
1863GB Seagate ST2000DM
6TB Seagate
465GB NVMe Samsung SSD 970
PSU
750G2
Case
Tower
Cooling
Standard
Keyboard
USB
Mouse
USB
Internet Speed
920Mbs/480Mbs
Antivirus
Malwarebytes
Browser
Firefox
The question is whether you want to automate it and whether you want to merge or replace when restoring.

If you just want to make a one-time backup with the intent to restore by merging (i.e. not backing up removal of registry keys that were present by default), the official Microsoft instructions work all the way back to Windows 9x. (Open Regedit, go File > Export Registry File > and make sure the "All" radio button is selected.)


I seem to remember the regedit command-line options not supporting dumping the root, which would be why, for scriping my Windows XP Pro retro-machine's on-shutdown backup, I used this .cmd script:

Code:
[FONT=monospace][COLOR=#000000]@echo off [/COLOR]
setlocal 
for %%k in (hklm hkcu hkcr hku hkcc) do call :ExpReg %%k 
goto :eof 
:ExpReg 
reg.exe export %1 %1.reg > nul 
gzip -f1 %1.reg 
if "%errorlevel%"=="1" ( 
  echo ^>^> Export --%1-- Failed. 
) else ( 
  echo ^>^> Export --%1-- Fine. 
) 
goto :eof 
endlocal[/FONT]


For dumping the raw hive files, the problem is basically the same as trying to dump the raw contents of a filesystem (which makes sense, given what the registry is) while it's mounted (Linux/UNIX/POSIX term basically meaning "assigned a drive letter and available for programs to interact with")... there's nothing ensuring that something won't change mid-backup, resulting in a corrupted backup.

(To use a visual metaphor, dumping the registry hives while they're in use is like trying to take a screenshot using a capture card without using VSync. You're gonna get tearing. Taking a backup using regedit is like taking a screenshot from inside the system, where it knows what belongs to which frame.)
 

My Computers My Computers

  • At a glance

    Windows 7 Home Premium Service Pack 1 64-bitIntel Core i3-2120 3.30GHz8.00 GBAMD Radeon HD 5870
    Computer type
    PC/Desktop
    Computer Manufacturer/Model Number
    HP Pavilion p7-1203
    OS
    Windows 7 Home Premium Service Pack 1 64-bit
    CPU
    Intel Core i3-2120 3.30GHz
    Motherboard
    (OEM)
    Memory
    8.00 GB
    Graphics Card(s)
    AMD Radeon HD 5870
    Sound Card
    (Realtek onboard)
    Monitor(s) Displays
    HP 2210m
    Screen Resolution
    1920x1080
    Hard Drives
    1TB WD Blue SATA SSD (SanDisk SSD G5 BICS4: 1000.2 GB)
    PSU
    Seasonic M12 II Bronze EVO Edition
    Case
    (OEM)
    Cooling
    (OEM)
    Keyboard
    Rosewill RK-9000I
    Mouse
    Logitech G203 Prodigy
    Internet Speed
    Irrelevant (blocked)
    Antivirus
    None (This gaming machine is blocked from Internet Access)
    Browser
    Firefox 115.0.2 64-bit (Used only with miniserve on LAN)
    Other Info
    Because the motherboard in this hand-me-down can't take more than 8GB of RAM, this machine is a "games console, except not a console" and is KVM-switched together with the triple-head Ryzen I daily drive.

    Also, the CPU cooler fan and chassis fan have been replaced with equivalent Noctua fans.
  • Computer type
    PC/Desktop
Back
Top