Nightly Maintenance

Nightly maintenance is an M-Files operation that does important maintenance tasks to keep your vault healthy. By default, M-Files starts the nightly maintenance every night at 4:30 AM server time. The number of tasks done during the nightly maintenance is different in different contexts. Additionally, you can control which operations are included in the nightly maintenance of a vault.

Nightly maintenance does, for example, these tasks for all vaults where it is enabled:
  • Does the full refresh operation for external object types
  • Deletes old relogin session IDs
  • Starts nightly maintenance for full-text search indices
If the vault uses Microsoft SQL Server as the database engine, nightly maintenance also does these tasks:
  • Updates database statistics from Microsoft SQL Server and starts SQL Server database optimization
  • Removes outdated server tasks
  • Stops SQL queries that have not completed in the time specified in the Time Limit for SQL Queries nightly maintenance setting
You can configure nightly maintenance to also do these tasks:

Editing nightly maintenance settings

You can control when and how M-Files does nightly maintenance for a vault.

  • In production environments, do not disable nightly maintenance.
  • Set nightly maintenance to be done when the vault is not used. Otherwise, it can cause performance issues. By default, nightly maintenance starts at 4:30 AM server time.
  • If you have large Microsoft Entra ID user groups, enable Run User Group Synchronization Only During Nightly Maintenance to set the synchronization to be done outside working hours. The synchronization can otherwise have a negative impact on system performance.
  • Have one of these two settings enabled:
    • Run Automatic State Changes During Maintenance
    • Run Automatic State Changes in the Background

To open the nightly maintenance settings of a vault:

  1. In M-Files Admin, go to the Advanced Vault Settings section.
    1. Open M-Files Admin.
    2. In the left-side tree view, expand an M-Files server connection.
    3. Expand Document Vaults.
    4. Expand a vault.
    5. Click Configurations.
    6. In the navigation area, click Advanced Vault Settings.
    7. Open the Configuration tab.
      Result:The advanced vault settings are shown.
  2. Expand Database > Nightly maintenance.
    For more information, select a setting and see the Info tab.