Backing Up and Restoring the Vault Search Index

As the search index of the vault is not included in a vault backup, and since re-creating the index for a large vault can take a large amount of time, you should always consider backing up the search index together with a vault backup. This section provides instructions for backing up and restoring the search index of your vault.

Backing up and restoring the vault search index (dtSearch)

Do the following steps to back up the vault search index when you are using dtSearch as your search engine:

  1. Copy the Indexes folder from the location of the vault data on the server (for example C:\Program Files\M-Files\Server Vaults\<vault name>\Indexes).
  2. Store the copied folder in a safe place.
    The index itself stores its state, and your backup of the index does not need to be as new as the vault backup.

Once you have a backup of your search index, do the following steps to restore the backed up search index:

  1. Take the vault offline.
    For instructions, see Taking a Vault Offline.
  2. Delete the Indexes folder and replace the folder with the backup.
  3. Bring the vault online.
    For instructions, see Bringing a Vault Online.
The indexing begins to catch up until the search index is completely up-to-date.

Backing up and restoring the vault search index (IDOL)

Do the following steps to back up the vault search index when you are using Micro Focus IDOL version 12 as your search engine:

  1. Use Windows Task Manager to stop the MFIndexingManager service.
    When the indexing service is stopped, no new material is added to the index.
    Note: In M-Files May '20 Update or later, M-Files Server migrates the index log files to IDOL and deletes the index log files from M-Files Server. If you use M-Files May '20 Update or later, you do not need to do the following step.
  2. Copy the existing index log files IndexFLog.log and IndexMLog.log or IndexCLog.log (in case of an external repository) and store the copied files in a safe place.
    The usual location of the log files is in the FileData and MetaData folders in C:\Program Files\M-Files\Server Vaults\<vault name>\Indexes\Combined\M-Files.
  3. Wait until all IDOL indexing queues in each content engine are empty.
    The queues are empty when the folders in the IDOL indexing queue are empty. The location of the IDOL indexing queue is for example E:\IDOL12\data\PROD1-content-12000\index\status.
  4. On the IDOL frontend server, open a browser.
    Note: If you have existing backup files created by the DREEXPORT command and you have not deleted them, you have to give new names to the backup files because the process does not overwrite.
    Note: You need to perform the following step on each backend engine and the daily index content engine.
  5. On the address bar of the browser, give the command http://<content engine IP address>:<content engine indexing port number>/DREEXPORTIDX?FileName=<optional path and backup file name>.

    Example: http://192.168.75.130:10001/DREEXPORTIDX?FileName=BU

    The command generates a file called <file name>-0.idx.gz into the folder of the content engine, for example in E:\IDOL12\data\PROD1-content-12000\index. The file includes all index data to the point of last full indexing batch.

  6. Start the MFIndexingManager service.
  7. Copy the backup files of the content engines from <IDOL installation directory or drive>\<content engine>\bin\single<content engine port range>\content into a safe place.

Once you have the backup of your search index in place, you can start the restore process. By default, the restore process uses the same folders as the backup. Do the following steps to restore the backed up search index:

  1. Use Windows Task Manager to stop the MFIndexingManager service.
    When the indexing service is stopped, no new material is added to the index.
  2. Wait until all IDOL indexing queues in each content engine are empty.
    The queues are empty when the folders in the IDOL indexing queue are empty. The location of the IDOL indexing queue is for example E:\IDOL12\data\PROD1-content-12000\index\status.
  3. On the IDOL frontend server, open a browser.
    Note: You need to perform the following step on each backend engine and the daily index content engine.
  4. To clear the whole index, give the command http://<content engine IP address>:<DIH/DAH indexing port>/DREINITIAL? on the address bar of the browser.
    Note: You need to perform the following step on each backend engine and the daily index content engine.
  5. Add the index from the corresponding backup by giving the command http://<content engine IP address>:<content engine indexing port>/DREADD?<optional backup file path and file name>-0.idx.gz.

    Example: http://192.168.75.120:10001/DREADD?BU-0.idx.gz

  6. Check the number of documents with MFAutonomyConsole using the getstatus action against the DIH and DAH engines.
    Note: If the backup has been taken before the M-Files May '20 Update, you have the index log files in addition to the IDOL index. In this case, perform the following step. If the backup has been taken after the M-Files May '20 Update, you do not need to perform the following step.
  7. Overwrite the index log files IndexFLog.log and IndexMLog.log or IndexCLog.log (in case of an external repository) with the backup files.
    The usual location of the log files is in the FileData and MetaData folders in C:\Program Files\M-Files\Server Vaults\<vault name>\Indexes\Combined\M-Files.
  8. Start the MFIndexingManager service.

You can run multiple backups or restores simultaneously with a PowerShell script in the backend engines and the daily index content engine.

Example of a backup script:

$navOpenInBackgroundTab = 0x1000;
$ie = new-object -com InternetExplorer.Application
$ie.Navigate2("http://192.168.75.128:9001/DREEXPORTIDX?FileName=BU");
# backup from Daily

$ie.Navigate2("http://192.168.75.130:10001/DREEXPORTIDX?FileName=BU", $navOpenInBackgroundTab);
# backup from backend server 1, engine 10001

$ie.Navigate2("http://192.168.75.131:20001/DREEXPORTIDX?FileName=BU", $navOpenInBackgroundTab);
# backup from backend server 2, engine 20001
$ie.Visible = $true;

Example of a restore script:

$navOpenInBackgroundTab = 0x1000;
$ie = new-object -com InternetExplorer.Application
#$ie.Navigate2("http://192.168.75.128:9001/DREADD? BU-0.idx.gz ");
# restore Daily

$ie.Navigate2("http://192.168.75.130:10001/DREADD?BU-0.idx.gz", $navOpenInBackgroundTab);
#restore backend server 1, engine 10001

$ie.Navigate2("http://192.168.75.131:20001/DREADD?BU-0.idx.gz", $navOpenInBackgroundTab);
# restore backend server 2, engine 20001
$ie.Visible = $true;