Step-by-step instructions to help you recover your data
You can use many methods to increase data availability for systems running Windows 2000 Server, including clustering, replication, and various RAID implementations. However, a fail-safe backup strategy is still the ultimate safety net to ensure that you can recover data after a catastrophic event. Countless books and articles outline the details of planning backup schedules, media rotation, and offsite storage for an effective backup program. But you might not know how to use your backed-up data to recover your Win2K server. With some clear direction and minor polish to your backup routine, you can make this process painless.
For the purposes of making this discussion germane to any Win2K Server installation, I'll frame the steps for recovering your backed-up data within the context of Win2K's native backup tool, Microsoft Windows Backup 5.0, also called NTBackup. Many third-party backup applications offer advanced features to enhance and simplify backup, restore, and recovery operations, but NTBackup provides the essential capabilities required for data protection. Additionally, some third-party programs can write to tape by using the Microsoft Tape Format (MTF), which facilitates recovery by using the native NTBackup program. (For a list of third-party backup solutions, see Buyer's Guide, "Backup Software," September 15, 2001, InstantDoc ID 22003, or visit the IT Buyer's Network, http://www.itbuynet.com.)
Let's document the steps to recover data from a Win2K server following a catastrophic failure. We'll assume the server acts as the only domain controller (DC), DNS server, DHCP server, and WINS server for a small company and has a hardware RAID controller hosting the system and data volumes. To prepare for disaster, you need to establish a solid backup routine and store your backup media and a record of your disk structure off site. Then, following a catastrophic failure, you'll be prepared to install a temporary OS, identify the contents of your backup media, restore the Normal and Differential backup sets, restore the System State data, restore any open files, and test your restored server and services.
Prepare for Disaster
I won't discuss in detail how to prepare for a catastrophic event, but I'd be remiss if I didn't mention some important steps you need to take before a disaster to ensure that you can safely recover your data. If you haven't developed a sound backup strategy that includes media rotation and offsite storage, put a process in place as soon as possible to ensure the safety of your data. (For information about backup strategies, see David Chernicoff, Forefront, "Stop Disaster in Its Tracks," July 2000, InstantDoc ID 8941, and Michael D. Reilly, Getting Started with NT, "Windows NT Backup Strategy," September 1999, InstantDoc ID 7111.) You'll want to follow best practices for using backup verification and execute backups using a user or system account with authority to access the appropriate data objects.
You can save yourself time and make recovery easier by maintaining a record of your server's disk structure for recovery purposes. You can easily document the disk and SCSI information with System Information (msinfo32.exe) by using the following syntax at the command prompt:
/report a:\diskcfg.txt /Categories +componentsstorage
You can keep the msinfo32-generated diskcfg.txt file on a 3.5" disk or print the file and take it to your offsite storage location. To ensure that you can quickly locate media at recovery time, be sure that the electronic media label written to the tape matches the physical media label.
For the purposes of our example scenario, let's assume that you perform weekly Normal backups and daily Differential backups. We'll also assume for this scenario that you use the default file selections identified by the Backup Wizard when backing up the Win2K server. These files include the System State selections, which are any Active Directory (AD), boot, COM+ Class Registration Database, registry, and Sysvol folder files.
Consider Your Environment
Your environment might require special procedures to handle open files at backup time. In our example, the DHCP and WINS databases are the only files that require special attention. Third-party products are available for managing open files during backup, or you can sometimes script a solution. To maintain fresh backups of the DHCP and WINS databases in our scenario, let's say you've created a small script, which Listing 1 shows, that your backup routine calls just before every backup job. To back up the DHCP database, you merely stop the DHCP service, copy the database file while it's closed, then restart the service. You then use the Net Shell tool (netsh.exe) to automate the WINS database backup procedure without needing to use the WINS console. Note that you must configure WINS with a default backup path, either through the console or Net Shell, before executing the Net Shell command in Listing 1.
During the weekend, a flash flood hit the building that houses your company and washed the server a few hundred yards downstream, completely destroying it. Thanks to good planning and adherence to best practices on your part, you've managed to secure at an offsite location media that contains backups through the previous Friday and documentation regarding the server's configuration. A replacement server and compatible tape drive have been delivered overnight, and your task is to have the server back online as soon as possible.
Install a Temporary OS
To begin, you need to have a working installation of Win2K on the server on which you plan to restore your data. Because this system will be a new server, you must install Win2K Server from CD-ROM. Verify that you've connected your tape drive and any other storage devices to the server before you begin the installation so that the OS can detect those devices during the installation. To expedite this phase, have all appropriate tape drive and SCSI drivers and system configuration documentation readily available, especially if your backed-up system drive exists on media for a storage device that doesn't have a native Win2K driver. If your device doesn't have a native Win2K driver, press F6 when the installation prompts you to specify your mass-storage device and supply a driver when setup prompts you to do so.
Other than configuring the tape drive and disk volumes, you don't need to spend time configuring the OS because the first restore will overwrite any settings you make. If you have a large amount of data to restore, you might have the option of first restoring the OS, then restoring the data after the server is back online. Let's assume that you must restore all partitions before the server will be functional: You need to create and format all partitions so that you can restore them in one operation. Refer to the diskcfg.txt file I described in the Prepare for Disaster section or other similar documentation when creating, formatting, and labeling volumes to ensure you're creating an accurate reproduction of the file systems that existed on your old server. You can use the partitioning phase of Windows Setup to create all the partitions before you format the OS partition and install the setup files. Make sure you create partitions that are at least as large as the original partitions on your old server to avoid problems during the restore process that might result from insufficient disk space. After you install the OS and boot into it, you can format the remaining partitions from the command line or with Disk Administrator by using the same file systems and drive mappings that the original server partitions used. You will also want to format the new file systems with the same cluster sizes that the original server used because a different cluster size can affect the amount of space the restored files consume.
Before you can restore your data, load the appropriate drivers for your backup device. You can check under the Tape drives device node in Device Manager, as Figure 1 shows, to verify that a driver is loaded for your tape drive. If your tape drive isn't present, look under the Other devices node for your device and load the driver according to the tape-drive manufacturer's instructions. To execute the restore operations, log on with an account that has enough authority to perform the necessary actions (i.e., an administrator or backup operator account).
Identify the Media Contents
If you understand your media management scheme well enough to know which media contain specific backup sets, you can insert the appropriate media when needed. Usually, however, you need to catalog several tapes to find the backup sets you need to recover your system. Open NTBackup (from the Start menu, select Programs, Accessories, System Tools, Backup). To streamline operations and ensure a successful restoration of the server, you'll need to select Tools, Options and modify some settings. On the General tab, select the Use the catalogs on the media to speed up building restore catalogs on disk and Always move new import media to the Backup media pool check boxes. These options expedite allocating media and cataloging media content. Then, under the Restore tab, select the Always replace the file on my computer check box, as Figure 2 shows, to let your restored data overwrite the current disk contents.
Now, when you insert your media into the tape drive, the tape will appear in the media pool listed on the Restore tab in the main NTBackup interface, as Figure 3 shows. From here, you can right-click the media's icon and choose Catalog to catalog the contents of that tape. Repeat this process, inserting new tapes until you identify and catalog the media that contain your most recent Normal and Differential backup sets. You're now ready to begin the first restore operation.
Restore the Normal Backup Sets
Select the Restore tab from the main NTBackup interface. From here you can highlight each piece of cataloged media to see a list of available backup sets. Select the most recent Normal backup sets for all volumes on your system. To make the selection process easier, click the Method column label to sort each set by backup method. Each backup set you want to restore should have a check mark in the box next to the volume name, and the method for each set should be Normal, as Figure 3 shows. Because NTBackup always uses the Copy method to back up the System State data, you don't need to restore this data at this point because the most recent System State backup occurred with the last Differential backup.
After you select which data you want to restore, select Original location in the Restore files to drop-down box and ensure that Always replace appears beneath the If files already exist text. Next, click Start Restore to open the Confirm Restore dialog box, then click the Advanced button to ensure that NTBackup will properly handle your restored files. Most important, assuming you're using NTFS volumes, make sure that you select the option to restore the appropriate security with your files. Other options will depend on whether you're using Removable Storage, Junction Points, Volume Mount Points, or File Replication Service (FRS) in your environment. Make your selections, then click OK twice to begin the restore process. If the correct media isn't in the drive, NTBackup will prompt you to insert it.
Restore the Differential Backup Sets and System State Data
After you successfully restore the Normal backup sets, NTBackup will prompt you to reboot your server. During the reboot, press F8 when Starting Windows is displayed to open the Windows 2000 Advanced Options Menu. Select Directory Services Restore Mode, which lets you perform a nonauthoritative restore of AD. (When and why you should perform an authoritative restore is outside the scope of this discussion, and the need to do so shouldn't coincide with a disaster-recovery operation. For information about performing an authoritative restore and a nonauthoritative restore of AD, see Sean Daily, "Repairing and Recovering AD," page 53.) Log on using an account with appropriate permissions to restore data.
Open NTBackup and select the Restore tab. The media you cataloged will still be present. This time, locate and select the most recent System State and Differential backup sets. The previous operation might have restored settings related to how NTBackup operates, so you might need to revisit the Options dialog box to make sure that restored files will overwrite the files on disk.
After you've made your selections and you're satisfied with your restore location and overwrite settings, click the Start Restore button. NTBackup will display a warning message about overwriting the System State. Click OK on the warning dialog box, then select the Advanced Restore Options button. When performing a nonauthoritative restore of AD, you must select the Restore junction points and restore file and folder data under junction points to the original location option. Verify that the other settings in the Options dialog box meet your needs, then click OK twice to begin the restore. NTBackup will prompt you to insert appropriate media if it isn't already in the drive and ask you to reboot the server following the restore.
Restore Open Files
The server is now online and you've restored all your data, but a few steps remain to finish the recovery process. You will recall that you wrote a quick script to back up the DHCP and WINS database files in the \%systemroot%\svcbak directory. To restore those two services to their predisaster state, you need to reverse the initial process you used to back them up.
For the DHCP database files, perform the following steps:
- Stop the DHCP service by typing at the command prompt
- Delete all files from the \%systemroot%\system32\dhcp directory.
- Copy all files from the \%systemroot%\svcbak\dhcp directory to the \%systemroot%\system32\dhcp directory.
- Restart the DHCP service by typing at the command prompt
For WINS, perform the following steps:
- Stop the WINS service by typing at the command prompt
- Delete all files from the \%systemroot%\system32\wins directory.
- Copy all files from your chosen WINS backup location to the \%systemroot%\system32\wins directory.
- Restart the WINS service by typing at the command prompt
Test the Server and Services
After you restart the services, use their respective consoles to verify the services are behaving properly; if possible, make sure the services are responding appropriately to client requests. Also, verify the functionality of other critical services and file systems on the server. If any problems exist, you'll hear about them from your users. By looking for any mistakes that require another restore from tape, you can head off problems now.
If You Really Need to Know, Test It
The procedure I've outlined for restoring your data after a disaster should serve as a model for drafting your own recovery process. A solid backup strategy and offsite storage of media and recovery documentation are keys to ensuring the recoverability of your servers. Slight variations in your environment might necessitate modifications to this process.
The only way to know exactly what's required for a foolproof recovery is to step through the process at least once (using a test server, not a production server), document all phases of the process, and create a collection of everything you used (e.g., tape drive and SCSI drivers, documentation of your server's disk configuration) to ensure a successful recovery. If possible, place these items, as well as a step-by-step procedure for executing the recovery, in a recovery kit and place the kit at your offsite media storage location. If you don't have the time to create your own document, perhaps you can use this article as a generic substitute.