Subscribe to Windows IT Pro

 

Get Newsletters

  • Get the Latest News
  • Product Updates
  • Helpful Tricks
  • Productivity Tips

Subscribe Now!

July 19, 2000 12:00 AM

Backing Up and Restoring the IIS Metabase

Windows IT Pro
InstantDoc ID #9159
Rating: (1)

The IIS metabase is a data structure for storing IIS configuration settings. In fact, the IIS metabase is a large, hierarchical data structure that supports inheritance. The IIS metabase serves a purpose similar to the Windows 2000 or Windows NT 4.0 Registry, but, unlike the Registry, the IIS metabase requires much less disk space because of its inheritance properties.

Because the IIS metabase contains frequently read and written data, you must back it up. IIS metabases can "break" when you persist bad data to them (it's rare, but accidents happen), and repairing them is difficult. In case you have a disaster that necessitates a restoration, you can use Microsoft Management Console's (MMC's) IIS snap-in in Win2K to restore the IIS metabase.

However, before you can restore an IIS metabase, you must first back it up (I suggest backing it up with the same frequency that you would back up your Microsoft SQL Server databases--maybe even more frequently.) To protect the important metabase data, Microsoft has made backing up the metabase a relatively easy task. Run the IIS snap-in by clicking Start, Programs, Administrative Tools, Internet Services Manager. Right-click the name of your IIS server in MMC, then select Back up/Restore Configuration. Click Create Backup, name your backup, click OK, and you're done. Unless you have an absolutely bloated metabase, the process is complete within seconds.

Restoring the metabase is just as easy. Choose the backup you want to restore, then click Restore. The warning "Restoring is a lengthy operation, which will wipe out all current settings and cause services to be stopped and restarted. Are you sure you want to continue?" appears before restoration begins.

Most IIS administrators want automated maintenance tools. In the IISsamples folder (\inetpub\iissamples\sdk\admin) on your Win2K server, you'll find four Windows Script Host (WSH) scripts that automate backing up and restoring the IIS metabase. Two scripts are for backing up the metabase (one written in VBScript and one written in JScript), and two are for restoring the metabase. These tools demonstrate how you can automate the process, which makes backing up the metabase even easier and more powerful.

The metaback.vbs script takes three parameters:

  • The name of the backup
  • The version (-v) number of the backup
  • A force flag (-f), which forces the overwrite of a backup even if the version exists

Get a command prompt, navigate to the \inetpub\iissamples\sdk\admin folder on your IIS 5.0 server, and type

cscript metaback.vbs myIISmetabaseBak 

When the backup is complete, go back to the IIS snap-in, right-click the name of your IIS server in MMC, and select Back up/Restore Configuration. You'll see the backup of the metabase you just made. (It's called myIISmetabaseBak, and the version number will be 0.) If you run the tool again, the utility will automatically increment the backup version to 1, and so on.

Now that you have a WSH script that backs up your IIS metabase automatically, it's simple to add a Win2K scheduled task to enable the script to run automatically at a scheduled time that you define. Open My Computer, then double-click the Scheduled Tasks folder. Double-click Add Scheduled Task to start the Add Scheduled Task Wizard. Click Next to move to the wizard's program selection page. Navigate to the metaback.vbs script and select it. Give the scheduled task a name, such as "Nightly IIS metabase back up." Choose Daily, and click Next. Choose a time that suits your needs. The task needs a security context under which to run, so choose a Win2K domain or local account that has privilege to run WSH scripts. On the last page of the wizard, select the Advanced Properties check box. Click Finish. When the Advanced Properties dialog box appears, click the Task tab, and change the Run: command to the syntax from above. After you click OK, you can right-click the task and select Run to test the task. After running the test, you can check for the next version of the backup you just created in the IIS snap-in.

Related Content:

ARTICLE TOOLS

Comments
  • jazamu
    4 years ago
    Aug 12, 2008

    gracias por la info

  • Bill Creswell
    8 years ago
    Jan 16, 2004

    Would like to know what is contained in the metabase backuo

You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

White Papers

Get your Windows 7 deployment off to the right start by implementing PC lockdown. A locked-down environment is easier and cheaper to support since users are less likely to make unnecessary changes to the core system configuration - read more here!

Essential Guides

Is your iSCSI "lossy"? The reality is that most off-the-shelf Ethernet hardware deployed for iSCSI can lose packets, resulting in slow performance or application downtime. Learn how to assess your current iSCSI infrastructure and engineer an advanced iSCSI SAN infrastructure.

Web Seminars

What's the best way to keep your network safe from malware? In this web seminar, security expert Greg Shields suggests an alternative method to the traditional blacklisting approach that is common with anti-virus and anti-malware solutions.

eLearning Series

We bring the experts direct to you to share their real-world perspective and expertise. During each event, three sessions stream in real time, so you can learn, ask questions, and get solutions.
Upcoming event: Getting the Most with Exchange 2010 with Paul Robichaux

Subscribe to Windows IT Pro!

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.