Restore

You can use the Restore method of the IIsComputer object to restore the metabase from a backup. The restore operation stops all services dependent on IISADMIN, including all servers, until the restore has completed, then restarts all services. Because of this, if you are restoring the metabase using an ASP script, you must specify a machine name different from the one on which your script is executing. You may not use LocalHost as the machine name. You should be careful to plan for this service interruption when restoring the metabase from a backup.

Syntax

IIsComputer.Restore BackupLocation, BackupVersion, BackupFlags 
 

Parameters

BackupLocation
A string of up to 100 characters that specifies the backup location. If an empty string is specified, the backup will be retrieved from the default location.
BackupVersion
Specifies the version number of the backup to be restored from the backup location, or may be the following constant.
MD_BACKUP_HIGHEST_VERSION Restore from the highest existing backup version in the specified backup location.


BackupFlags
Reserved. Must be zero.

Code Example

<% 
Dim ComputerObj, ComputerName 
' Restore metabase on a different computer 
ComputerName = "MyOtherComputer"
' You can use LocalHost if running under Windows Scripting Host 
Set ComputerObj = GetObject("IIS://" & ComputerName) 
' Restore the highest number version in MyBackups 
ComputerObj.Restore "MyBackups", MD_BACKUP_HIGHEST_VERSION, 0 
%> 
 

Remarks

You can use the Restore method with the LocalHost computer object in scripts running in a command window using Cscript.exe. See Windows Scripting Host Programmer's Reference.

See Also

Backup, EnumBackups, DeleteBackup


© 1997 by Microsoft Corporation. All rights reserved.