Expand description
Backup and restore of the database and the file vault.
A backup directory written by backup contains:
db.dump pg_dump --format=custom
vault/objects/ab/cd/<sha> content-addressed blobs (without the preview cache)
manifest.json timestamp, version, object count and SHA-256 of db.dumppg_dump and pg_restore are spawned with an argument array, never
through a shell. The database password is passed in the child’s
PGPASSWORD environment only; it never appears in an argument or a log
message.
Structs§
- Backup
Summary - Result of a successful backup.
- Restore
Summary - Result of a successful restore.
Functions§
- backup
- Writes a backup of the configured database and vault into
dir. - backup_
encrypted - Like
backup, with every file encrypted with a key derived frompassphrase(seecrate::backupcrypt). The plain dump exists only for the moment betweenpg_dumpand its encryption, insidedir. - is_
encrypted - Whether the backup in
diris encrypted (from its manifest). - restore
- Verifies a backup directory and restores it into the configured database
and vault. A database that already contains tables requires
force. - restore_
with - Like
restore; an encrypted backup needs itspassphrase. The dump is decrypted to a temporary file in the vault’stmp/forpg_restoreand removed afterwards; objects are decrypted straight into the vault.