BACKUP

Since 1.1.0ServerKiviDB command

Syntax

BACKUP
  • Flags: admin
  • ACL categories: @admin, @dangerous, @server, @slow
  • Arity: -1

Takes a consistent backup of the dataset while the server keeps serving: a snapshot as of the start, then the writes that follow, up to the moment it is sealed. KiviDB's own command. See its subcommands.

A sealed backup is three files in the backup directory, backupdir under the working directory unless backupdirname says otherwise: appendonly.aof.N.base.kdb, appendonly.aof.N.incr.aof and appendonly.aof.manifest. Restoring it gives the dataset as it was when it was sealed, not when it started, so the nodes of a cluster can each start a backup in turn and then be sealed together. It works with the AOF on or off, on a master or a replica.

To start a server from a backup:

kividb --preload-file aof:/path/to/appendonly.aof.manifest   # a sealed backup
kividb --preload-file rdb:/path/to/dump.kdb                  # a single snapshot

The file given is loaded instead of the usual dump.kdb and appendonly.aof; one that cannot be loaded stops the server. backup-sealed-ttl removes a sealed backup after that many seconds; 0, the default, keeps it.

Subcommands

  • BACKUP ABORT: Cancels a backup that has not been sealed; its state becomes failed, with the error aborted.
  • BACKUP CLEANUP: Removes the files of a sealed or failed backup.
  • BACKUP HELP: Lists the BACKUP subcommands and what each does.
  • BACKUP LIST: Returns the paths of the backup's files that are complete and safe to copy: the snapshot; once sealed, also the writes and the manifest.
  • BACKUP SEAL: Ends the backup: it now holds everything up to this moment, and its manifest is written.
  • BACKUP START: Starts a backup: writes a snapshot of the dataset as of now into the backup directory, then collects the writes that follow.
  • BACKUP STATUS: Returns the backup's state, its error if it failed, and its start and end times.