How to restore Sitecore database from backup


Description

The article provides recommendations on how to restore Sitecore databases from backups properly.

After you have restored a Sitecore database from a backup:

  1. Run the following query against the database that has been restored:
    TRUNCATE TABLE [EventQueue]
    TRUNCATE TABLE [PublishQueue]
    TRUNCATE TABLE [Properties]
  2. Rebuild the search indexes specific to the database that has been restored, for example, the sitecore_master_index for the Master database.

Important note

Failure to perform the steps given in the Description might lead to the following issues:

Note that starting from Sitecore XP 10.3, a warning is logged if a search index is out of sync with the EventQueue table:

[Index=sitecore_master_index] SolrSearchIndex: The last updated timestamp of the strategy is 54321 and exceeds the Stamp of the latest EventQueue entry 12345. Please rebuild the index to reinitialize the value.