The IMSAdminBase::SaveData method explicitly saves the metabase data to disk. The metabase data is saved in the metabase storage file, by default named metabase.bin in the inetsrv directory, or to the file specified in the Windows registry key LOCAL_MACHINE\\SOFTWARE\\Microsoft\\INetMgr\\Parameters if the file has been relocated as discussed in Metabase Security and Reliability.
You must not have a handle open with write permission when you call this method, or the method will fail. The process waits for a few seconds for handles to close, so other processes with write handles open should not normally interfere with the save operation.
HRESULT SaveData( void );
Returns an HRESULT that contains one of the following values:
Value | Description |
ERROR_PATH_BUSY | The path specified cannot be used at this time. |
ERROR_SUCCESS | The method succeeded. |
File system error codes | See winerror.h for information about specific error codes. |
All data in the metabase is saved, including data written by other applications.
This method will fail and return ERROR_PATH_BUSY if there are any open write handles to the metabase.
Metabase data is saved when IIS shuts down, so you usually do not need to call this method. However, for critical data it is recommended that you call it whenever appropriate for your application.