Backups and restoration
Make, check and restore backups, move to a new server, and switch between local and S3 storage.
Tessra's backup command writes one .tar file that holds everything needed to rebuild the installation:
- a consistent snapshot of the database (accounts, tokens, files, share links), taken with SQLite's backup API so Tessra can keep running;
- the key ring from
/data/keys, which sessions and stored share links need; - the contents of every file, read through the configured storage (local or S3) and checked against the SHA-256 recorded when it was uploaded;
- a manifest with the size and SHA-256 of everything above.
Uploads an intake automation is still processing and uploads in quarantine are not in the backup either: their content lives only in /data/temp and /data/quarantine. After a restore they show as quarantined with nothing to release, and expire with the quarantine retention.
Configuration (.env, Compose file, proxy config) is not in the backup. Keep those, and the secrets in them, somewhere safe as well.
A backup contains password hashes, encryption keys and every file. Treat it like the server itself: the file is created readable only by the Tessra user, and copies you make should be encrypted (see Off-site copies).
The examples assume the Compose setup from Install, with a ./backups folder mounted at /backups.
Make a backup
docker compose exec tessra dotnet Tessra.Api.dll admin backup /backups/
Backup written to /backups/tessra-backup-20261128T034500Z.tar (1,284,331,520 bytes).
1 user(s), 2,310 file(s), 1,904 share link(s), 2,310 object(s).
Options:
| Option | Meaning |
|---|---|
/backups/ (a folder) | Writes tessra-backup-<UTC time>.tar into it. You can also give a full file name. |
--keep <n> | After a successful backup into a folder, deletes older tessra-backup-*.tar files there, keeping the newest n. |
--no-blobs | Leaves file contents out. Only for S3 storage that you back up separately (see S3). |
If a stored file is missing or its bytes no longer match the checksum from upload, the backup is not written and the error names the affected files. Restore them from another copy or delete them in Tessra, then try again.
Daily backups
With cron on the Docker host (the DigitalOcean installer sets this up):
30 3 * * * root cd /opt/tessra && docker compose exec -T tessra dotnet Tessra.Api.dll admin backup /backups/ --keep 7 >> /var/log/tessra-backup.log 2>&1
A backup that includes file contents needs about as much free space as your files, plus the database size in /data/temp while it runs.
Check a backup
docker compose exec tessra dotnet Tessra.Api.dll admin verify-backup /backups/tessra-backup-20261128T034500Z.tar
This reads the whole archive and checks every checksum without changing anything. Run it on copies you keep off-site, too.
Restore
Restore into a stopped Tessra. It refuses to run while a Tessra server is using the same data directory.
docker compose stop tessra
docker compose run --rm tessra admin restore /backups/tessra-backup-20261128T034500Z.tar
docker compose up -d
The restore:
- checks every checksum in the archive, and refuses a backup made by a newer Tessra than the one running;
- refuses to replace an installation that already has an account or files, unless you add
--force. With--force, the current database and keys are moved to/data/pre-restore-<time>/rather than deleted; - writes the files into the configured storage, swaps in the database and keys, and applies any database migrations this version needs;
- re-reads the newest files from storage and checks them against their checksums, then prints a few share links with the SHA-256 they should serve:
Restored the backup made 2026-11-28 03:45 UTC by Tessra 0.1.0.
1 user(s), 2,310 file(s), 1,904 share link(s), 2,310 object(s). 2,310 object(s) written to local storage.
Checked the 10 newest files against the checksums recorded at upload: all match.
After starting Tessra, these share links should download files with the listed SHA-256:
https://files.example.com/s/Qm9...Xc/raw sha256 81018ae0ac2c...
Start Tessra again to use the restored installation.
After starting Tessra, spot-check one of them:
curl -s https://files.example.com/s/Qm9...Xc/raw | sha256sum
Sign in with the account from the backup. Existing share links, ShareX tokens and deletion links keep working. Browser sessions from before the backup also survive, because the keys are restored.
Uploads that were still in progress when the backup ran did not finish, and are cleaned up during the restore.
Move to a new server
- On the old server, make a backup and copy it off, e.g.
scp root@old:/opt/tessra/backups/tessra-backup-*.tar . - On the new server, install Tessra as usual with the same
Tessra__BaseUrl(and the same storage settings, unless you are moving storage). Do not complete first-run setup. If the installer started Tessra, stop it:docker compose stop tessra. - Copy the backup into the new server's
backupsfolder and make it readable by Tessra:sudo chown 1654 backups/*.tar. - Run the restore and start Tessra, as above.
- Point DNS at the new server.
The restore treats an installation with no account and no files as empty, so step 2 does not need --force.
S3 storage
By default a backup copies every file out of the bucket into the archive, so it protects you even if the bucket is lost. For large buckets that can be slow and needs local disk. If you protect the bucket another way, back up only the database and keys:
docker compose exec tessra dotnet Tessra.Api.dll admin backup /backups/ --no-blobs
A restore of such a backup checks that every file it refers to exists in the configured bucket with the right size, and stops without changing anything if one is missing.
Protecting the bucket itself is up to your provider's tools: replication to a second bucket or region, or a scheduled rclone sync to other storage. Versioning helps against overwrites and accidental deletes, but it is not a backup on its own: it does not survive deleting the bucket or losing the account.
Moving between local and S3 storage
A backup that includes file contents can be restored into an installation configured with different storage. The restore writes every file into the new storage and records it there.
- Make a backup (without
--no-blobs). - Stop Tessra and change the storage settings in
.env. docker compose run --rm tessra admin restore /backups/<file> --force(--forcebecause the installation already has data).- Start Tessra and check a few files.
Files in the old storage are not deleted. Remove them yourself once you are satisfied.
Off-site copies and encryption
Backups on the same disk as the server do not protect against losing the server. Copy them somewhere else and encrypt them on the way. Some options:
- restic or Borg: encrypted, deduplicated repositories, e.g.
restic -r s3:... backup /opt/tessra/backups. - rclone with a
cryptremote, to any cloud storage. - age for a single file:
age -r <public key> -o backup.tar.age tessra-backup-....tar.
Keep at least one copy that the server's own credentials cannot delete. Test a restore from it now and then, for example into a throwaway Compose project on another machine.
Recovery checklist
-
verify-backuppasses on the copy you restore from. - The restore printed no problems.
- You can sign in, and the Files page shows what you expect.
- A share link printed by the restore downloads with the listed SHA-256.
- ShareX can upload with an existing token.
- Once you are satisfied, delete
/data/pre-restore-*if the restore made one.