Skip to content

Backup and restore

All of Fret’s state lives in the data folder (/data in Docker, FRET_DATA_DIR otherwise). Your downloads live in the warehouse and are backed up like any other files.

File Content
fret.db Shipments, parcels, tracking history, register, accounts, settings, password, sessions and API tokens
fret.db-wal, fret.db-shm Recent changes not yet merged into fret.db (present while Fret runs)
secret.key The key that encrypts the credentials of your accounts

Back up secret.key together with the database: without it, the saved credentials of your carriers and forwarders cannot be read (everything else still works, and you only have to enter them again). Keep both as carefully as a password.

The simplest consistent backup: stop Fret, copy the folder, start Fret again. Transfers resume where they were.

Terminal window
docker compose stop fret
docker run --rm -v fret-data:/data -v "$PWD":/backup alpine \
tar -czf /backup/fret-data.tar.gz -C /data .
docker compose start fret

With a host folder mounted on /data, or with the binary, copy the folder itself.

The database runs in WAL mode: copying fret.db alone while Fret writes may give an incomplete copy. For a hot backup, use SQLite’s own backup command from the host (the image has no sqlite3), on the data folder:

Terminal window
sqlite3 /path/to/data/fret.db ".backup '/path/to/backup/fret.db'"
cp /path/to/data/secret.key /path/to/backup/
  1. Stop Fret.
  2. Put fret.db and secret.key back into the data folder, and delete any fret.db-wal and fret.db-shm left there.
  3. Start Fret.

A database from an older version is migrated automatically at startup. A database from a newer version than the program is not supported: restore it with the version that made it, or a newer one.

Install Fret on the new machine, stop it, restore the data folder as above, and copy the warehouse to the same relative layout. The register points at folders relative to the warehouse root, so the root itself may change.

Built with Kiln