Recipe12.16.Backing Up and Restoring the Metabase


Recipe 12.16. Backing Up and Restoring the Metabase

Problem

You want to back up or restore the metabase. You may need to restore it if the metabase becomes corrupt or your server bites the dust.

Solution

Using a graphical user interface

To back up the metabase, do the following:

  1. Open Internet Information Services (IIS) Manager.

  2. In the left pane, right-click on the node representing your IIS server and select All Tasks

    Click the Create Backup button and type a name for your backup.

  3. If you want to password protect your backup, select the Encrypt backup using password checkbox, and type and confirm a password.

  4. Click OK and then Close.

To restore a previously backed up metabase configuration, do the following:

  1. Open Internet Information Services (IIS) Manager.

  2. In the left pane, right-click on the node representing your IIS server and select All Tasks

    Select the metabase backup you want to restore and click the Restore button.

  3. Click Yes to restart IIS services and enter the password if your metabase backup is password protected.

  4. Click OK and then Close when the restore is finished.

To restore the metabase from a metabase history (automatic backup) file, do the following:

  1. Open Internet Information Services (IIS) Manager.

  2. In the left pane, right-click on the node representing your IIS server and select All Tasks

    Select the metabase history file (named Automatic Backup) you want to restore and click the Restore button.

  3. Click Yes to restart IIS services.

  4. Click OK and then Close when the restore is finished.

To restore the metabase to its initial configuration when IIS was installed, do the following:

  1. Open Internet Information Services (IIS) Manager.

  2. In the left pane, right-click on the node representing your IIS server and select All Tasks

    Select the backup named Initial Backup and click the Restore button.

  3. Click Yes to restart IIS services.

  4. Click OK and then Close when the restore is finished.

Using a command-line interface

The following command backs up the metabase using the iisback.vbs script and names the two backup files 28july04.MD0 (for MetaBase.xml) and 28july04.SD0 (for MBSchema.xml):

> iisback /backup /b 28july04

To view a list of the current metabase backups, use the following command:

> iisback /list

If you create another backup with the same name as the previous one, the version number will be incremented by one. To overwrite version 0 of the backup instead and create a new backup, do the following:

> iisback /backup /b 28july04 /v 0 /overwrite

The following command restores the password-protected backup named My Metabase Backup:

> iisback /restore /b "My Metabase Backup" /e <password>

Using VBScript

For a good example script on how to backup and restore the metabase, see the code for iisback.vbs in the IIS 6 Resource Kit.

Discussion

Table 12-7 lists the three kinds of metabase backups. The Subfolder column contains the subfolders under %SystemRoot%\system32\inetsrv in which the backup is stored.

Table 12-7. Types of metabase backups

Name of backup

Subfolder

Description

Initial Backup

\MetaBack

Automatically created when IIS is installed

Automatic Backup

\History

Automatically created whenever configuration changes have been made since the in-memory metabase was last flushed to disk

<any_name>

\MetaBack

Manually created by an administrator as described in this recipe


Whenever the metabase is backed up, both the metabase configuration file (MetaBase.xml) and metabase schema (MBSchema.xml) are backed up. The automatically generated initial backups are named as follows:

  • The initial backup of MetaBase.xml file is named Initial Backup - created automatically by IIS setup.MD1.

  • The initial backup of MBSchema.xml file is named Initial Backup - created automatically by IIS setup.SC1.

History files are named using major and minor version numbers as follows:

  • MetaBase_<majorversion>_<minorversion>.xml

  • MBSchema_<majorversion>_<minorversion>.xml

For example:

  • MetaBase_0000000043_0000000000.xml

  • MBSchema_0000000043_0000000000.xml

The major version number is incremented when you:

  • Manually restart IIS using IIS Manager

  • Manually stop IIS using IIS Manager or net stop

  • Right-click on the IIS computer node in IIS Manager and select All Tasks Wait for IIS to automatically flush the in-memory metabase to disk when configuration changes have been made

The minor version number increments after you've enabled edit-while-running (see Recipe 12.15), manually edited the metabase configuration file (%SystemRoot%\system32\inetsrv\MetaBase.xml), and saved the changes. If the major version number is incremented, the minor version number is reset to zero.

Manually created backup files are named according to the name you assign, for example:

  • 28July04.MD0

  • 28July04.SC0

If you create a second backup the same day, the new files would be named:

  • 28July04.MD1

  • 28July04.SC1

Regularly creating password-protected metabase backups is a good idea for two reasons:

  • The security properties of the metabase are encrypted. These include, for example, AdminACL, which contains the discretionary access control list (DACL) that controls access to metabase keys.

  • You can restore the backup to a different IIS 6 computer if your original computer crashes.

If you had an SSL-enabled web site on your crashed computer, however, you'll need to install your server certificate on your new computer and restart IIS on the new computer.

See Also

Recipe 12.15 and MS KB 324277 (How To Create a Metabase Backup by Using IIS 6.0 in Windows Server 2003)



Windows Server Cookbook
Windows Server Cookbook for Windows Server 2003 and Windows 2000
ISBN: 0596006330
EAN: 2147483647
Year: 2006
Pages: 380
Authors: Robbie Allen

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net