Backing Up the Registry Via System State Backups

Using the export function of Registry Editor is a great idea prior to making any Registry edits, but far from the only option to restore previous settings if something goes wrong. For example, you could also create a restore point using System Restore in Windows XP or ME prior to making Registry changes, since the restore point will contain your current settings.

Along the same lines, Microsoft does not recommend using Registry Editor as the primary method of backing up and restoring the entire Registry in XP. Instead, you should use the Backup tool, to both backup and restore what is known as System State data. System State data include the Registry as well as important system files, however, so the backup is typically much larger. However, it is a more reliable way to handle Registry backup and restore operations. If you’re running XP Home edition, the Backup utility is not installed by default, but is included on the XP CD. See the stepped procedures below for more information on installing the Backup utility and backing up System State data.

Step 1: Backup is not installed on XP Home by default. Insert your XP CD and browse to the \valueadd\msft\ntbackup folder. Double-click on the NTBACKUP.MSI file, to begin the installation. Once the automated installation is complete, click Finish.

Step 2: Click Start, and then select All Programs, Accessories, System Tools, and click Backup. The Welcome to Backup or Restore Wizard window will appear. Click Next.

Step 3: At the Backup and Restore screen, ensure that Back up files and settings is selected, and click Next. At the What to Back Up screen, select Let me choose what to back up, and click Next.

Step 4: At the Items to Back Up screen, expand My Computer, and click on System State. This will display the components included in a System State backup, including the Registry. Check the checkbox next to System State, as shown above, and then click Next.

Step 5: At the Backup Type, Destination, and Name screen, click the Browse button to choose a folder where the backup should be saved. In the backup name text box, give the backup a descriptive name such as SystemStateJuly0606. Click Next.

Step 6: On the Completing the Backup or Restore Wizard screen, click Finish. The Backup Progress window will appear. Once the backup is complete, check the location specified to ensure that the System State backup file specified exists.

Importing Data into the Windows Registry

Importing Registry settings from an existing file can be as simple as double-clicking a REG file, or using the Import feature from the File (or Registry) menu in Registry Editor. While importing settings isn’t difficult, it’s important to understand the implications of importing different types of files.

When you import a REG file, any settings (keys, values, and data) that are not currently found in the Registry are added. Where data settings in the file are different from existing settings, those settings will be changed to reflect the contents of the file being imported. This is an important consideration. For example, let’s say that you wanted to remove a set of values and data that you had added manually using Registry Editor – double-clicking on the REG file that you created before making the changes would not remove those settings. When a REG file is imported, it simply merges new data into the Registry, and changes existing values as required.
This is one of the reasons why exporting the Registry as a hive file (in XP) is a great idea.

Although you cannot manually edit these files, they create a binary “snapshot” of all existing Registry settings. Then, when you choose to import a hive file, all existing settings in that particular key are completely overwritten with the contents of the hive file. For example, let’s say that you were to export to a hive file, add entries to that same key using Registry Editor, and then import the hive file – the whole key would be overwritten with the settings in the hive file, along with those manual additions. Importing hive files is a quick and easy way to “get back where you were” in cases your manual edits go awry.

Windows Registry Export Methods

The Windows Registry Editor makes it simple to export settings, so there really is no excuse for not doing this prior to making any change. Depending on the OS you’re running, your options will be different, however. In Windows 98/ME, you have the option of exporting Registry settings into a Registration file, more commonly known as a REG file. At the most basic level, a REG file is a formatted text file that contains information about values and data stored in the Registry, as well as the associated path to where the values and data are stored. The benefit of this file type is that Registry values contained in the file can be imported by simply double-click on the file and confirming the action.

If you’re running Windows XP, Registry information can be exported in four main formats – Windows XP REG files, Registry hive files, text files, and as Windows 9X/NT 4.0 REG files (for backwards compatibility). Only the first three types should concern you, since it’s unlikely that you’ll be trying to migrate settings from XP to a Windows 9X or NT 4.0 system.

Exporting to a REG file in Windows XP is similar to doing the same in Windows 98/ME, producing a formatted text file that can be quickly imported. Choosing to export to a Registry hive file is a very different option – it creates a binary image of whatever key(s) you have specified for export, and has a very important use that we’ll look at shortly. However, you cannot view these files in a traditional text editor like Notepad. The last option, exporting to a text file, literally creates a text file in a manner similar to a REG file, but cannot be imported – use this option for documenting settings rather than as a backup.

To export Registry settings in XP, browse to the particular key that you want to export (sub-keys, values, and data will be included), and then choose Export from the File menu. After providing a descriptive File name, click the Save as Type drop-down menu, select the appropriate option, and click Save.

Windows Registry Tools and Concepts

The primary tool used to edit the Registry on a Windows 98, ME, or XP system is Registry Editor, Regedit.exe. The easiest way to get to this tool is from the Run command – simply type regedit, click OK, and you’re off to the races.

Behind getting into the details of importing and exporting settings, it’s important to have a basic understanding of the Registry structure. While closely resembling a folder and file structure similar to browsing the contents of a disk, the terms used to describe Registry elements are different. At the top level of the Registry, five main folders exist (six in Windows 98/ME), known as hives (or sometimes as “root keys”). Each contains different types of information, ranging from user settings to general system settings to security information. Any folder beneath a hive is known as a key, with a folder within a key known as a sub-key; simply calling all folders “keys” is also acceptable.

Within any given folder (key), you’ll find values. Values are the placeholders for the actual Registry settings, known as data. For example, a value called UserName might consist of data like “John Doe”. When editing the Registry, you are typically changing the data associated with existing values, although sometimes, you may be adding completely new values and their associated data.

Introduction to the Windows Registry

No doubt you’ve read the warnings, because they appear right next to just about any Registry modification or tweak that you’ve ever seen. You know the ones – “modifying the Registry may render your system unusable”. Microsoft adds a similar clause every time they mention a Registry change, and with good reason. Even the slightest wrong turn inside the Registry, and you can easily turn even the most stable system into a nightmare.

While editing the Registry is dangerous, it can also be fun. Digging through the Registry allows you to tweak and tune settings not usually exposed within the Windows interface. It truly gets you “under the hood” of your system, which is why so many users want to poke around in there in the first place. Prior to even considering making a change, however, you absolutely must get into the habit of doing a proper backup. It takes almost no time at all, and can absolutely save hours or days of pain if something does go wrong. In this mini-series we’ll explore various ways of exporting (backing up) and importing (restoring) Registry settings.