[This is preliminary documentation and subject to change]

# Naming the Metabase History Files

To keep track of metabase history in a useful manner, IIS uses the following versioning scheme to enumerate the copies of MetaBase.xml that are stored within the history folder.

## Metabase Version Numbers

- The HistoryMajorVersionNumber metabase property value, also referred to as the major version number, increments when the in-memory metabase is written to disk.
- The minor version number is incremented when Editing the MetaBase.XML File While IIS Is Running is enabled and an administrator changes and saves the MetaBase.xml file directly with an application such as Notepad.

### The HistoryMajorVersionNumber Property

The HistoryMajorVersionNumber property is located under the IIS_Global node in the metabase as shown in the following snippet:

    <?xml version ="1.0"?>
    <configuration xmlns="urn:microsoft-catalog:null-placeholder">
    <MBProperty>
    <IIS_Global   Location ="."
       ChangeNumber="3008"
       HistoryMajorVersionNumber = "218"</IIS_Global>

Important The HistoryMajorVersionNumber property is used by IIS to track the versions of the metabase. It is inadvisable to manually change the value of the HistoryMajorVersionNumber property.

#### Minor Version Number

The minor version number is not a property that is stored within the metabase. Instead, IIS calculates the minor version number each time a file is written to the history folder as follows:

- If the history file is created because the in-memory metabase is written to disk, the minor version number is reset to zero.
- If the history file is created because the MetaBase.xml file is edited and saved directly and if edit-while-running is enabled, IIS looks within the history folder to determine the last minor version number that was used for a history file with the same HistoryMajorVersionNumber number as MetaBase.xml. IIS then uses the next highest minor version number when naming the new history file.

## Naming the History Files

When a copy of MetaBase.xml is written to the history folder, the value of the HistoryMajorVersionNumber property and the calculated minor version number are added to the names of the file pair that is created within the history folder.

Respectively, the filenames of versioned MetaBase.xml files and MBSchema.xml files are created in the following format, where both the HistoryMajorVersionNumber value and the minor version number are 10-digit numbers:

MetaBase_HistoryMajorVersionNumber_minor version number.xml
MBSchema_HistoryMajorVersionNumber_minor version number. xml

When either the HistoryMajorVersionNumber or the minor version number value is less than a 10-digit value, the number is padded with zeros in the filename to create a 10-digit number. This keeps the filenames aligned and in numerical order when sorting by filename, making the contents of the history folder easier to read.

Examples of Filenames Within the History Folder

MetaBase_0000000001_0000000000.xml
MetaBase_0000000001_0000000001.xml
MetaBase_0000000002_0000000000.xml
MetaBase_0000000002_0000000001.xml
MetaBase_0000000002_0000000002.xml
MetaBaseError_0000000000.xml
MetaBaseError_0000000001.xml
MBSchema_0000000001_0000000000.xml
MBSchema _0000000001_0000000001.xml
MBSchema _0000000002_0000000000.xml
MBSchema _0000000002_0000000001.xml
MBSchema _0000000002_0000000002.xml

For each instance of a MetaBase_majorversion_minorversion.xml file within the history folder, there is a MBSchema_majorversion_minorversion.xml file of the same version that was used with the metabase configuration.

#### Metabase Error Files

Filenames containing the word error are created in the history folder under the following circumstances:

- Editing the MetaBase.XML File While IIS Is Running is enabled.
- MetaBase.xml is edited directly, using an application such as Microsoft Notepad.
- An error such as the following occurs:
  - An XML tag is omitted in MetaBase.xml.
  - A property name is misspelled in MetaBase.xml.
  - The corresponding history file is not found.

Error files are named in the following format, where TenDigitNumber is the version number of the error file starting with version number 0000000000:

MetaBaseError_TenDigitNumber.xml

IIS increments the version number by one for each additional error file that is created.

Related Topics

- For more information about metabase history, see The Metabase History Feature.
- For more information about editing the metabase file while IIS is running, see Editing the MetaBase.XML File While IIS Is Running.
- For information about metabase rollback, see Metabase Reliability.

phrase 1, phrase 2, phrase 3

© 1997-2001 Microsoft Corporation. All rights reserved.