Tuesday, August 22, 2006

How & Why You Should Backup Registry Files

If you ever come across Windows boot error when it fails to load one or more (corrupted) registry hives, you can follow the steps explained in MS KB307545 to recover from corrupted registry. Having said that, lets understand few non-obvious facts.

When Windows is installed, it creates a backup of all the registry files in \%SYSTEMROOT%\repair\, whereas all the active registry files that Windows uses during run time are stored in \%SYSTEMROOT%\System32\Config. If any of the registry files inside \Config folder is corrupted, you can use Recovery Console to recover registry files from \repair folder to \config folder. There is however one significant consequence - the system will lose all the softare installation settings and system configuration done since Windows installation because registry files inside \repair folder are never updated after Windows installation, so after recovering those files the system essentially goes back to the same state when it was first installed (KB307545: "...This registry was created and saved during the initial setup of Windows XP. Therefore any changes and settings that occurred after the Setup program was finished are lost...").

To avoid this consequence, you can periodically update \repair folder using NTBACKUP tool. NTBACKUP doesn't have any specific option to update registry files, but all you need to do is take a System State backup, which will create a flat .BKF file, but will also update the \repair folder with copies of all registry files from \config folder. You can later delete that .BKF files because all we want to accomplish here is to update \repair folder with the most recent copy of registry files. It is also very easy to automate this entire process by creating a scheduled backup job which runs once a week (or depending on how frequently you change system settings or install/uninstall softwares) and overwrites the same BKF file. Here is a related article which addresses similar requirement - http://www.windowsitpro.com/Article/ArticleID/24657/24657.html

No comments: