Vault Maintenance

Regular vault maintenance makes sure that there is high performance even for vaults with a large number of objects. The Maintenance submenu for a vault in M-Files Admin contains functions to verify and optimize the integrity of the internal database structure. It also contains functions to rebuild the full-text search index and to reset thumbnail images in the vault. Also, it is important to regularly verify the integrity of your vault and master database backups. See also Manual Optimization.

Optimize Database

The Optimize Database (Thorough) operation tries to make the performance of the vault database better. The operation defragments indexes, updates database statistics, and compresses the full-text search index.

M-Files automatically runs the Optimize Database (Thorough) operation once a week. Normally, it is not necessary to do this yourself at all. However, if the vault responds more slowly than usual, it can be necessary to run the operation. The vault can respond slowly after a large number of objects is imported to the vault (for example if the number of objects in a vault that uses Firebird as the database engine quickly increases from 0 to 10,000 objects).

You can run the operation in the Quick mode first, but we recommend to use the Thorough mode in most cases.

These tasks are done when you run the Optimize Database (Thorough) operation:
  1. taking the vault offline (for vaults that use Firebird or Microsoft SQL Server as the database engine)
  2. rebuilding metadata indexes
  3. recalculating relevance scores for objects
  4. cleaning out unused access control lists
  5. clearing the change logs of object types
  6. upgrading the vault database to improve performance
  7. backing up metadata (only for vaults that use Firebird as the database engine)
  8. restoring metadata (only for vaults that use Firebird as the database engine)
  9. rebuilding database indexes
  10. updating the statistics for database objects
  11. compressing the full-text search index
  12. finalizing the operation
  13. bringing the vault online (only for vaults that use Firebird as the database engine)
These tasks are done when you run the Optimize Database (Quick) operation:
  1. rebuilding metadata indexes
  2. recalculating relevance scores for objects
  3. clearing the change logs of object types
  4. updating the statistics for database objects

Update encryption status of existing files

The selection of the setting Enable encryption for file data at rest in the Document Vault Advanced Properties has an effect on the functionality of the Update encryption status of existing files operation:
  • If the Enable encryption for file data at rest is selected, all the files in the vault previously not encrypted are now encrypted as well.
  • If the Enable encryption for file data at rest is not selected, the encryption of all the encrypted files in the vault is removed.

Rebuild Full-text Search Index

This operation completely rebuilds the full-text search index, and can take up an extensive amount of time in large repositories. For example, in vaults with tens of gigabytes of data, the operation can take several days.

We recommend to run this operation if you think that the search index is corrupted or if the search operations are slower than usual. In large repositories, especially if the objects get modified a lot, we recommend to run this operation twice per year.
Note: Normally, the operation disables search functions in the vault. Refer to Rebuilding the dtSearch Full-Text Search Index in M-Files knowledge base for instructions on how to perform the rebuild process without disabling search functions for the duration of the operation.

Reset Thumbnail Images

You can reset the thumbnail image cache for the vault if you use the thumbnail view in M-Files Desktop and if the images are not working correctly. This can happen, for instance, after installing a software capable of displaying thumbnails that could not previously be shown.

Verify and Repair

You can use this operation to verify that the database is intact and that all the data has been saved correctly to M-Files. The Thorough mode additionally checks whether file checksums of the physical files in the vault file data location match those reported by the metadata database.

If errors are found, M-Files can repair some of them automatically, but some errors can need user actions. If you have errors that cannot be resolved automatically, and that you cannot fix yourself, please contact our customer support at [email protected].

We recommend to run the Verify and Repair (Thorough) operation twice per year.

These tasks are done when you run the Verify and Repair operation:
  1. verifying vault information
  2. verifying special records
  3. verifying data file records
  4. verifying physical data files
  5. verifying file records
  6. verifying file link records
  7. verifying object versions
  8. verifying object properties (general integrity checks)
  9. verifying object properties (detailed integrity checks)
  10. finalizing the operation

The steps during the Verify and Repair (Thorough) and Verify and Repair (Quick) operations are the same, with the exception that during the verification of physical data files (step 4) for Verify and Repair (Thorough), file checksums are calculated and compared against the checksums recorded in the metadata database.

Maintenance recommendations

Here is a summary of the recommended maintenance operations:

  • It is not necessary to run the Optimize Database operation regularly. M-Files does it automatically.
  • Run the Rebuild Full-text Search Index operation twice a year for large repositories (with hundreds of thousands of objects and hundreds of gigabytes of data).
  • Use the Reset Thumbnail Images operation only if the thumbnail images do not work correctly.
  • Run the Verify and Repair (Thorough) operation twice a year for all repositories.
  • Verify the integrity of your vault and master database backups two to four times a year, at minimum. If the embedded Firebird SQL database is used, see Backing Up a Document Vault, Restoring a Document Vault, and Backing Up the Master Database. If Microsoft SQL Server is used, refer to the documentation of the backup tools you use to create the backups. Also, see M-Files Backup Policy for further guidelines and best practices related to backups.