Compartilhar via


IMSAdminBase::Backup

The IMSAdminBase::Backup method backs up the metabase to a location you specify by providing a backup location name of up to 100 characters in length. Multiple metabase backups can be stored in a backup location.

Note

IIS determines the backup storage mechanism, so the backup location name you provide does not necessarily translate to a particular directory, file, or database storage mechanism. As implemented in this release, metabase backups are stored as files in the system32\inetsrv\MetaBack directory. This mechanism may change in future releases.

HRESULT Backup(
      LPCWSTR pszMDBackupLocation,
      DWORD dwMDVersion,
      DWORD dwMDFlags
);

Parameters

  • pszMDBackupLocation
    A string of up to MD_BACKUP_MAX_LEN Unicode characters that identifies the backup location. The storage mechanism will be determined by IIS. If an empty string is specified, the default backup location will be used.

  • dwMDVersion
    The version number to be assigned to the backup. Must be less than or equal to MD_BACKUP_MAX_VERSION. Can be set to one of the following values:

    MD_BACKUP_HIGHEST_VERSION

    Meaning

    MD_BACKUP_NEXT_VERSION

    Use the next backup version number available in the specified backup location.

  • dwMDFlags
    One or more of the following flags:

    MD_BACKUP_FORCE_BACKUP

    Meaning

    MD_BACKUP_OVERWRITE

    Back up even if a backup of the same name and version exists in the specified backup location, overwriting it if necessary.

    MD_BACKUP_SAVE_FIRST

    Perform a SaveData operation before the backup.

Return Values

Returns an HRESULT that contains one of the values listed in the following table. Other errors can also be returned that are passed through from the file system, or from a CryptoAPI when secure metabase data is being saved.

Value

Description

E_INVALIDARG

An argument was invalid.

HRESULT_FROM_WIN32(ERROR_NOT_ENOUGH_MEMORY)

Insufficient memory to perform the operation.

S_OK

The method succeeded.

MD_WARNING_SAVE_FAILED

This is a warning, not an error.

Requirements

Client: Requires Windows XP Professional, Windows 2000 Professional, or Windows NT Workstation 4.0.

Server: Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server 4.0.

Product: IIS

Header: Declared in iadmw.h; include iiscnfg.h.