Upgrade and back up
This page shows how to upgrade with Docker Compose, how to back up, and what you can and cannot rebuild by rescanning.
On this page
In the beta, applied database updates cannot be undone, so it is a good idea to export a copy with pg_dump before you upgrade; see Back up by hand.
Upgrade#
-
Save the old log. An upgrade recreates the container and its old log disappears with it:
docker logs --timestamps <server-container> > server-before-upgrade.log -
Pull the new image. If you installed with the install script, run the same install command again instead: it does these two steps for you and keeps your data. Otherwise run:
docker compose pull docker compose up -d --wait -
Wait until the container is healthy. Do not restart it. A new version may update the database, and then the start takes longer than usual. On a large library the database update can take a minute or two. The health check can fail briefly and connections can be refused during that time. That is normal.
- Check. Sign in to the admin console, check the version number, check that the library item counts did not change, and play something.
Going back#
Applied database updates cannot be undone automatically. To return to an older version, stop the services and restore a full backup made before upgrading. A full restore keeps item numbers and watch history, so you do not have to rescan.
Back up by hand#
This works on every plan. Export a full copy of the database with pg_dump:
docker compose exec -T postgres pg_dump -U kryspal -d kryspal --format=custom > full-before-upgrade.dump
Run it in the folder with your compose.yaml (/opt/kryspal-media if you used the install script). Also copy the data volume, which holds the server's keys and settings. docker volume ls shows its name: the compose folder's name (or kryspal-media for the install script) followed by _data. The image cache is under cache in that volume and rebuilds itself, so the command leaves it out:
docker run --rm -v kryspal-media_data:/data:ro -v "$PWD":/backup alpine tar czf /backup/kryspal-data-$(date +%F).tgz --exclude=./cache -C /data .
Backup files contain sign-in credentials. Keep them in a private folder.
Backup and restore PRO · MAX#
Open System → Backup in the admin console.
What is backed up: the database, server settings, keys and member avatars. Not included: library images and covers, caches, pre-generated posters, trailers, and your media files. For a complete copy, back up the whole server data folder yourself.
Back up now#
- Press Back up now. It finishes before it answers; a large database can take more than a minute.
- Optional: set a Password (8 to 128 characters). The file is then encrypted (AES-256), and you must type the password to restore. A forgotten password cannot be recovered, and the server does not store it. Only backups you make by hand with a password are encrypted; automatic backups are never encrypted.
Without a password, the backup contains the server keys. Anyone with the file can read plugin settings, so keep it safe.
Automatic backups#
Automatic backups need PRO. They run every day at 04:00; you can change the time under Tasks → Schedule. By default the 7 newest are kept (you can keep up to 100), in the backups folder inside the server data folder. On the Backup page you can change the backup location (a folder that exists on the server and is writable) and how many backups are kept. Automatic backups beyond that number are deleted, oldest first. Manual backups and pre-restore backups do not count. Overview warns you when the last successful backup is more than 48 hours old.
Backups are listed with their type (Automatic, Manual, Before restore) and whether they are encrypted. You can download or delete a backup from the list.
Restore#
- In the list, press Restore next to the backup you want.
- Read the warning: the current database and settings are replaced, and everything changed since the backup is lost. A backup of the current state is made first.
- Type
restoreto confirm, and enter the backup password if it has one. Press Schedule restore. - Restart the server. The restore is applied after the restart. Until then the server keeps using the current data. You can cancel a scheduled restore with Cancel restore.
What a rescan cannot rebuild#
These live only in your database and server data, so back them up: members and passwords, device sign-ins, library settings, watch history, custom uploaded images and covers, and key files. After a rescan, item numbers change, so watch history must come from a backup. A rescan cannot bring it back.
Keep backups private#
A backup file counts as a credential. Keep its permissions at 600. On a NAS, a shared folder can pass on permissions that make the file readable by others, so check.
Without a license#
The Backup page needs PRO. Without it, you can still back up the database by hand, as described in Back up by hand.