Backup and restore
Backups are the operator’s responsibility; Kanadr provides the two commands. They run on the VM, as root, with the service’s settings.
What a backup contains
A .tar archive:
- the whole database: the Kanadr data and the telephony engine data;
- the keyring of the encryption keys. Without it, the database secrets (trunk and email server passwords, webhook and two-step verification secrets…) would be unreadable; it is therefore included, and the archive is as sensitive as the machine: it is created readable by its owner only, to be kept outside the VM, encrypted or in a protected place;
- the telephony engine files: call recordings, voicemail, announcements, music on hold;
- a manifest: Kanadr version, schema version, date.
The machine configuration (nginx and its certificate, telephony engine configuration, systemd units) is not part of it: it comes from the installation.
Backing up
Live, services running:
sudo kanadr sauvegarder --sortie /srv/backups/kanadr-$(date +%F).tar
Schedule it daily (systemd timer or cron), copy the archive outside the VM, and keep several generations.
Each successful backup is recorded in the database (date, size, machine): the Backups and certificate module of the Home page shows how many days ago the last one was made.
Restoring
On a VM installed with the same version (or a newer version) of Kanadr:
-
Describe the archive, without replacing anything:
sudo kanadr restaurer --archive kanadr-2026-10-12.tar -
Stop Kanadr and the telephony engine (
sudo systemctl stop kanadr kanadr-moteur), then restore, with--confirmer. The database is replaced in one transaction; keys and files are copied back, then the telephony engine cache is emptied. -
If the archive comes from an earlier version:
sudo kanadr migrate. An archive from a newer version is refused. -
Restart the telephony engine, then Kanadr (
sudo systemctl start kanadr-moteur kanadr).
Try a restore on a test VM from time to time: a backup never restored is not a backup.