I accidentally imported my old registry backup

1

I accidentally imported my old registry backup during a cleanup process. Is there any way to undo that? enter image description here

user148469

Posted 2019-12-12T06:48:50.247

Reputation: 23

Restore your latest backup. That's about all you can do. You won't be able to recover the overwritten values so even using the registry file as a template as to what was changed isn't going to be of much help. – Seth – 2019-12-12T07:05:37.130

@Seth All I have now is a backup from a couple of months ago. I am just worried that the old registry might conflict with the newly installed updates and software. – user148469 – 2019-12-12T07:09:58.287

1It probably will. You messed up and there isn't really any easy way to fix it. The easiest options are to restore a backup; reinstall your OS or just hope that everything works out. – Seth – 2019-12-12T07:13:22.023

1You can’t replace a live registry hive with a backup of registry hive. You can only mount it. What steps did you perform exactly? – Ramhound – 2019-12-12T07:20:19.683

@Ramhound I created a backup copy of my registry a couple of months ago by exporting it from the registry editor. Today I wanted to clean up the broken registry using a third party software, so I decided to create a backup copy as I did before, but unfortunately, I clicked "import" instead of clicking "export". I selected my old registry backup and instantly my current registry got replaced with that one. – user148469 – 2019-12-12T07:52:16.720

I am guessing you didn’t do this with the built-in registry editor? If you replaced the registry hive with a backup then the live registry hive was likely instantly replaced although you didn’t notice some changes until a reboot happened. There is no solution to your problem. – Ramhound – 2019-12-12T07:55:36.550

@Ramhound Yes, I imported my old registry with the built-in regedit.exe. The third-party software can only scan for broken registry items and delete them. I rebooted my PC several times, nothing seemed to change. Btw, the backup was only 3 months old. No major windows updates were done. – user148469 – 2019-12-12T11:20:51.560

The built-in registry tool won't let you replace your registry hive, only mount another register hive, submit a screenshot of register editor with none of the hives expanded – Ramhound – 2019-12-12T11:24:27.590

@Ramhound I have attached the image. I accidentally imported the "reg backup.reg" file in my registry editor. – user148469 – 2019-12-12T11:52:31.000

@user148469 - Alright; I thought you had done something completely different. There is no reversing the changes If you don't have a backup of the keys before you changed them there is no way to undo the changes you imported. – Ramhound – 2019-12-12T13:12:28.577

Answers

2

Windows auto-backs up the system registry hives, but doesn't with user hives (HKCU/HKU)

  • An update a few months back disabled the automatic backups, which can be re-enabled by:

    Reg Add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager" /v EnablePeriodicBackup /t REG_DWORD /d 1 /f
    


If the OS hive backups exist, they will be located in %WinDir%\System32\config\RegBack

  • Verify:

    cmd /c Dir "%WinDir%\System32\config\RegBack"
    
  • Restore:

    • CLI: (requires booting to WinRE)

      1. Boot to WinRE
        • Settings > Update & Security > Restore - Advanced startup > Troubleshoot - Advanced > Command Prompt
        • If unable to boot to Windows, hard reset the PC 2x when BIOS/UEFI hands off to the Windows bootloader (i.e. as soon as you see the Windows logo at boot, power off the PC), as upon failing to boot 2x consecutively, WinRE is auto-loaded
      2. Determine what drive letter the Windows OS partition has been assigned:
        • Notepad > CTRL + O > This PC
          - or -
        • Diskpart > lis vol
      3. Issue:

        :: # Change "D:" To Correct Drive Letter
        
          :: # Create Backup Directory:
             cmd /c Mkdir "D:\Windows\System32\config.bak"
        
          :: # Create Backup Of All Files In Config Store
             cmd /c Copy "D:\Windows\System32\config" "D:\Windows\System32\config.bak"
        
          :: # Copy Backup Hives Into Config Store 
             cmd /c Copy "D:\Windows\System32\config\RegBack\*" "D:\Windows\System32\config"
        
    • GUI:
      1. WinKey + R > Open: regedit > Approve UAC
      2. File > Import
      3. Select backup hive to restore from %WinDir%\System32\config\RegBack
        • Depending on the hive, it may not be possible to import it while booted to Windows

JW0914

Posted 2019-12-12T06:48:50.247

Reputation: 2 135

@JWD09 Thanks a lot! I was mostly worried about the system hives since those might conflict with the newly installed updates. I hope everything works out fine now – user148469 – 2019-12-12T15:45:35.233

Makes me wonder why Microsoft disabled auto backup of the registry? My last backup was 11-18-2017 – Moab – 2019-12-13T15:59:17.457

@Moab They released a statement about it, but I can't recall where I found it. IIRC, it was due to Microsoft believing most don't use this feature. I'm also unsure as to what system event prompts the OS to backup the hives, as you would think there's been a decent amount of registry changes that would prompt a backup when the current one is two years old. – JW0914 – 2019-12-13T16:05:23.177

Makes me wonder if a system restore point contains a registry backup and which parts. – Moab – 2019-12-13T16:38:47.533

1@Moab I believe a system restore restores at least some of the hives, but I'm not sure which ones it does (it may restore all)... at worst, one would need to create a restore point, restore to an earlier point, copy %WinDir%\System32\config to a location not affected by a restore, then restore back to the point created before the restore. – JW0914 – 2019-12-13T16:51:38.087