Knowledge base / Operation
Backup and moving
Encrypted backups on a schedule, restoring, and moving to a new server.
Kontris backs up the database and the documents itself, into an encrypted file with the extension .chbk.
Switching it on
- Open Administration → Settings → Manage backups.
- Switch on the schedule and choose the time and the retention in days.
- Click Back up now once and check that the backup appears in the list.
If the server is not running at the scheduled time, the backup is created after the next start.
Where the backups are
The default is the folder backups in the local document storage, on the server that is /opt/contracthub/files/backups. This does not protect against losing the disk. Either include the folder in the server’s backup, or choose another configured storage (S3, Azure) as the location.
Encryption
Backups are encrypted with a key derived from SECRETS_ENCRYPTION_KEY.
Without this key every backup is worthless. Keep it separate from the backups, for example in your password manager.
Restoring
From the list of backups or after uploading a .chbk file. Kontris first creates a safety backup automatically, then replaces the database and writes the documents back. Afterwards all users are signed out. During the restore users see a maintenance page.
Kontris rejects a backup from a newer version. Update the application first in that case.
Command line
For when the interface is not reachable:
docker compose exec contracthub node dist/backup.js list
docker compose exec contracthub node dist/backup.js create
docker compose exec contracthub node dist/backup.js restore <backup-id or path.chbk>
docker compose restart contracthub
extract decrypts a backup into an empty folder. It contains an ordinary SQL dump and the files:
docker compose exec contracthub node dist/backup.js extract <backup-id> /tmp/backup
Moving to a new server
- Old server: Back up now, then Download. Change nothing there from now on.
- New server: set up Kontris as described in the installation, with the same
SECRETS_ENCRYPTION_KEY. - Sign in as admin, upload the backup and restore it. This works without a license; the backup brings it along.
- Stop the old server so that two instances do not both send reminders.
If the address of the installation changes with the move, you need a license for the new address.
PostgreSQL
Stay on PostgreSQL 16. Moving to a higher major version does not work by replacing the image; it goes through a backup and a restore into a new, empty database.
As of 2026-11-15 · Stuck? Write to us