Maintaining a proper backup routine ensures that you'd be able to restore your data to its state at chosen points in time.
Use this overview as an introduction to backing up and restoring your databases.
The two principal reasons for backing up your database are -
Securing data in case catastrophe strikes.
Freezing data in chosen points in time to retain access to it in various stages of its existence/development.
RavenDB's Backup is an Ongoing task.
Routinely backing up your data is a fundamental aspect of your database maintenance.
Backup is therefore provided not as a one-time operation, but as an ongoing task
that runs in the background.
It is configured once and then executed periodically according to the defined schedule.
You can create and configure backup tasks using the Client API or
in Studio navigate from Tasks -> Backups -> Create a Periodic Backup.
You can set the Backup task to create either full or incremental backups during its periodical executions.
A full backup contains all current database contents and configuration.
The creation of a full-backup file normally takes longer and requires more storage space than the creation of an incremental-backup file.
An incremental backup contains only the difference between the current database data and the last backed-up data.
An incremental-backup file is normally faster to create and smaller than a full-backup file.
When an incremental-backup task is executed, it checks for the existence of a previous backup file.
If such a file doesn't exist, the first backup created will be a full backup.
Subsequent backups will be incremental.
A Typical Configuration
A typical configuration would include quick incremental-backup runs that "fill the gaps" between full backups.
For example -
A full-backup task is set to run every 12 hours,
and an incremental-backup task that runs every 30 minutes.
Backup Name and Folder Structure
Backup folders and files are named automatically.
Their names are constructed of:
Current Date and Time
Backed-up Database Name
Backup Type ("backup" or "snapshot")
Backup Scope ("full-backup" or "incremental-backup")
2018-12-26-16-17.ravendb-Products-A-backup is the name automatically given to a backup folder.
"2018-12-26-16-17" - Backup Date and time
"Products" - Backed-up Database name
"A" - Executing node's tag
"backup" - Backup type (backup/snapshot)
2018-12-26-16-17.ravendb-full-backup is the name automatically given to the backup file inside this folder.
"full-backup" - For a full backup; an incremental backup's name will state "incremental-backup".
A typical backup folder holds a single full-backup file and a list of incremental-backup files that supplement it.
Each incremental backup file contains only the delta from its predecessor backup file.
For example -
Stored backup data can be Encrypted or Unencrypted.
A backup always consists of a single compressed file.
It is so for all backup formats: Full "logical" backup dumps, Snapshot images, and the Incremental backups that supplement both.
By default, backups are not deleted. The backup retention policy sets a retention period,
at the end of which backups are deleted. Deletion occurs during the next scheduled backup task
after the end of the retention period.