Recover a server
When a server is lost, its Salvo can come back as it was: jobs, destinations, history and the vault with the keys of the backups. What makes it possible is the recovery copy and the recovery key saved in step 2 of Get started.
● available on the command line (0.4.108) planned on the screen
The recovery copy
- Salvo keeps an encrypted copy of its database and vault in every destination, in
_salvo-recuperacao/<server>/, encrypted with the recovery key. - It is updated at the end of every good backup.
# the copy in each destination: when, size, ok or error
/var/lib/salvo/salvo recovery-status
# write the copy now (all destinations, or one)
/var/lib/salvo/salvo recovery-copy-now
/var/lib/salvo/salvo recovery-copy-now --destination ID
Bring a lost server back
● order tested in 0.4.1081. Install Salvo on the new server, the normal installation (no --clean). Do not open
the setup assistant.
2. List the copies in the destination (does not need the key):
/var/lib/salvo/salvo recover-server --type sftp --path /FOLDER --host HOST --port PORT --user USER --key-from /root/storage-key --known-hosts-from /root/known_hosts --list
For a folder on this server: --type local --path /FOLDER --list.
3. Recover the chosen server, with the same state folder as the installation (/var/lib/salvo by default):
/var/lib/salvo/salvo recover-server --type sftp --path /FOLDER --host HOST --port PORT --user USER --key-from /root/storage-key --known-hosts-from /root/known_hosts --server NAME --key-file /root/recovery-key.txt --state /var/lib/salvo
It checks the sha256 of the copy, decrypts it with the recovery key and restores the database and the vault. The
empty database the installation created (and its vault) is moved to /var/lib/salvo/antes-da-recuperacao-<time>/;
the salvo binary stays where it is, so the WHM screen keeps working.
4. Open Salvo in WHM: it comes back with the destinations, the jobs and the catalog of backups.
| Option | |
|---|---|
--server NAME | which server, when the destination has copies of more than one (the names shown by --list) |
--key-file FILE | the .txt downloaded in step 2 of Get started (or --key KEY; an argument shows in ps) |
--password-from FILE | instead of --key-from, when the storage uses a password |
--trust-host-key | instead of --known-hosts-from: accepts the storage's SSH key without checking it |
--force | the server already has a Salvo in use (with a destination or job): its database and vault are moved to antes-da-recuperacao-<time>/ first; the binary stays |
Without --force, recover-server refuses a server whose Salvo is already in use.
The database was lost, the vault was kept
catalog-rebuild recreates the catalog of backups from the repositories of a destination (it only reads there):
/var/lib/salvo/salvo catalog-rebuild --destination ID