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, for example, verify and optimize the integrity of the internal database structure. It is also important to regularly verify the integrity of your vault and master database backups.

It can be helpful to see the Why is my M-Files not as fast as it used to be? FAQ article. It contains many frequently encountered issues that can cause system slowness.

Important: M-Files does continuous database maintenance during use, especially with the thorough optimization process. If you use Microsoft SQL Server, do not use any maintenance operations with Microsoft SQL Server Management Studio. At best, they have no effect, but they can cause negative effects on the performance of your M-Files system. With some Microsoft SQL Server editions, manually used maintenance operations can even prevent the use of M-Files during the operation.

Maintenance recommendations

Summary of the recommended maintenance operations:

  • Use the Reset Thumbnail Images operation only if the thumbnail images do not work correctly.
  • Use the Verify and Repair (Quick) operation twice a year for all repositories.
  • Clean the vaults at least once a year.
  • Archive M-Files event logs at least once a year.
  • Verify the integrity of your master database backups at least two to four times a year.
  • Verify the integrity of your vault backups at least two to four times a year.
    • If Microsoft SQL Server is used, refer to the documentation of the backup tools you use to create the backups for instructions.
    • If Firebird SQL database is used, see Backing Up a Vault and Restoring a Vault for instructions.
    • When you restore test vaults, make sure that you do not accidentally overwrite the production vault. In addition, when you restore a vault with a new GUID, make sure that you do not let the restored vault, when asked, use any external connections. This can cause problems if the production vault uses the same connections. Finally, please make note that the restored vault can cause, for example, scripts to be executed and assignment emails to be sent.
    • Refer to M-Files Backup Policy for further guidelines and best practices related to backups.

For a recommended maintenance schedule, see the table in How do I maintain the M-Files server machine?.

See Important Tasks after Installation, Vault Creation, or Vault Migration for a checklist of tasks that we recommend to be done with operations listed in the section.

Optimizing the database

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

By default, M-Files does the Optimize Database (Thorough) operation once every week. To change the default schedule or specify a timeout for the optimization, see Scheduled Optimization.

Normally, it is not necessary to do the operation yourself. However, if the vault operates more slowly than usual, it can be necessary to do it. 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 quickly increases from 0 to 10,000 objects.

You can do the operation in the quick mode first, but we recommend to use the thorough mode in most cases. For instructions, see Manual Optimization.

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

See Task Order in Thorough Optimization for the list of tasks done during the thorough operation.

Updating encryption status of existing files

The selection of the setting Enable encryption for file data at rest on the Advanced tab of the Document Vault Properties dialog 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.

After you have run the Update encryption status of existing files, you must manually run the Optimize Database (Thorough) operation to remove the old file data of the vault. If the option Delete the files of destroyed objects is available, select it.

Rebuilding the full-text search index

This operation is to be done only if you think that the search index is corrupted or if the search operations are significantly slower than usual. For use instructions, see Managing Vault Indexing.

The best practice is to create a duplicate index in the background. Please write to our customer support at [email protected] or contact your M-Files reseller for further assistance.

Please take note of this important information before you start the operation:

  • This operation completely rebuilds the full-text search index and it can require a very large amount of time. For example, with vaults that contain a million, millions, or tens of millions of documents, indexing can take days or even weeks. Many factors, such as the used indexer, hardware resources, and type of data in the vault can have a considerable effect on the indexing speed.
  • During the rebuild process, search operations can be used but the search results can be limited because the search index is not complete. For instructions on how to have the search operate normally during the process, refer to Rebuilding the dtSearch Full-Text Search Index.

Resetting 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.

Cleaning the vaults

When you clean the vaults, you release disk space for new objects.

To clean a vault:
  1. In M-Files Admin, export the content that you want to remove from the vault.
    Example filter:
    • Status tab: Deleted set to No
    • Properties tab: Created property with the <= operator and the value set to a date
  2. In M-Files Desktop, delete the objects that you have already exported and enable Destroy permanently.
    Note: When you search for objects to delete and destroy, use the same filters as in step 1. This makes sure that you only destroy content that you have exported.
  3. In M-Files Admin, manually optimize the database.

    Enable Delete the files of destroyed objects.

    Note: The scheduled automatic optimization does not remove the destroyed files.