Search code examples
ravendbdatabase-backups

RavenDB Periodic Backups: How can I "clear the ledger" and force a full backup every so often?


When you enable RavenDB's 'Period Backups' bundle, RavenDB does the following:

  1. Backs up the entire database.
  2. At every interval (or 'n' minutes), RavenDB makes an incremental backup (or delta backup) of all the changes that occurred since the last interval.

I'm comfortable with this configuration with one caveat.

Every week, I'd like to "clear the ledger" and force RavenDB to backup the entire database and resume making incremental backups from this new starting point.

How can I do this in an automated fashion?


Solution

  • From the Raven.Backup utility documentation:

    • incremental - Optional. When specified, the backup process will be incremental when done to a folder where a previous backup lies. If dest is an empty folder, or it does not exist, a full backup will be created. For incremental backups to work, the configuration option Raven/Esent/CircularLog has to be set to false.

    So the solution to my problem is:

    • Every week, delete the dest directory.
    • This will force RavenDB to create a full backup.