Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 


July 19, 2000

Backing Up and Restoring the IIS Metabase


RSS
Subscribe to Windows IT Pro | See More Backup and Recovery Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

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.

End of Article



Reader Comments
Would like to know what is contained in the metabase backuo

Bill Creswell January 16, 2004


gracias por la info

jazamu August 12, 2008 (Article Rating: )


You must be a registered user or online subscriber to comment on this article. Please log on before posting a comment. Are you a new visitor? Register now




Top Viewed ArticlesView all articles
Battery Life Issues Almost Certainly Not Windows 7's Fault

While Microsoft is still investigating a notebook battery life issue that was supposedly caused by Windows 7, some interesting trends have emerged. ...

Getting your iPhone to Sync with Exchange 2003

Follow these steps to use an iPhone with Exchange. ...

Confirmed: Battery Life Issues Not Windows 7's Fault

Microsoft on Monday issued a lengthy statement about the recent Windows 7 battery controversy, echoing my assessment from earlier in the day, but backing it up with hard, cold evidence. Put simply, Windows 7 is not responsible for any battery life issues ...


Storage Whitepapers Turn to a Proven Server and Storage Migration Solution

The Impact of Disk Fragmentation on Servers

Take Control of Your Email: Understand the Business Reasons for Email Storage Management

Related Events Why We Do Backups and Do We Even Know How to Use Them?

New Year Savings Plan: How to get more out of your backup with new technologies like data deduplication, server virtualization and others

Real World Applications of Storage Strategy

Check out our list of Free Email Newsletters!

Storage eBooks A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Keeping Your Business Safe from Attack: Encryption and Certificate Services

Related Storage Resources Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2010 Penton Media, Inc. Terms of Use | Privacy Statement