Upgrades & backups
Upgrading
Section titled “Upgrading”-
Make a backup: Admin › Backup, Back up now. The new version migrates the database as it starts, and a migration can’t be undone: going back to the previous version means restoring this backup.
-
From the repository’s root, check out the files of the version you are moving to, then fetch its images and start it:
Terminal window git fetch --tagsgit checkout v1.15.0docker compose pulldocker compose up -dUse the tag of the release your
IMAGE_TAGpoints at (below): with the defaultlatest, the newest one on the releases page. Onedge, check outmaininstead.
The compose files and .env.example come with the code, and the images
with IMAGE_TAG: both have to match. git pull on main brings files
written for changes not released yet, which a release image may not
understand, or a variable it requires without using it.
The API applies database migrations on its own as it starts: nothing else to run. Skipping several versions is fine; read the notes of each one you skip.
Before upgrading, read the changelog and the notes below: a few releases ask for a step of your own.
Choosing what you run
Section titled “Choosing what you run”IMAGE_TAG in .env picks which images docker compose pull fetches,
for amd64 (most servers) and arm64 (Raspberry Pi, ARM NAS) alike:
IMAGE_TAG |
What you get |
|---|---|
latest (default) |
The latest release. Moves only when a new version comes out. |
1, 1.12 |
The latest release within that major or minor version: fixes come, larger changes wait for you. |
1.12.0 |
That exact release, until you change it. |
edge |
Every commit merged into main, as loomkeep.app runs it. Newer, less settled. |
| a 12-character commit SHA | That exact build of main. Only the 30 most recent stay available. |
Each release’s notes, on GitHub and in the changelog, say when an upgrade asks for a step of your own.
Checking an image
Section titled “Checking an image”Each image published from main carries two records, stored next to it in
the registry:
- a provenance signed through Sigstore with GitHub’s identity, which proves it was built by this repository’s workflow from a given commit;
- an SBOM, the list of every package it contains, in SPDX format.
With the GitHub CLI, check an image before running it:
gh attestation verify oci://ghcr.io/logan2234/loomkeep-api:latest -R Logan2234/loomkeepand list what it contains:
docker buildx imagetools inspect ghcr.io/logan2234/loomkeep-api:latest --format '{{ json (index .SBOM "linux/amd64").SPDX.packages }}'Replace api by web for the other image, and linux/amd64 by
linux/arm64 on an ARM server. Images built before 1.15 have no signature.
Notes needing action
Section titled “Notes needing action”- Instance settings moved out of Unleash. Social features, gamification,
registration and the public API are now set in
Admin › Instance settings. Flags of the
same names in Unleash are ignored. A variable in
.envstill wins: removeSOCIAL_ENABLED& co. from it to manage them from the page.
Backups
Section titled “Backups”Loomkeep backs its database up every night at 3 a.m. on its own, keeping the last seven. Each dump is encrypted before it touches the disk, for a key only you hold:
-
On your own machine, not the server, create a key pair with age:
Terminal window age-keygen -o loomkeep-backup-key.txt -
Copy the
age1…public key it prints intoBACKUP_ENCRYPTION_PUBLIC_KEYin.env. -
Keep
loomkeep-backup-key.txtsomewhere safe and separate, like a password manager. Without it, no backup can ever be read.
Admin › Backup lists the backups, makes one on demand, downloads or deletes them, and restores one, which replaces the whole database.
Off the server
Section titled “Off the server”Backups kept on the server die with it. Copy them elsewhere regularly. The
repository’s docker/backup-offsite.sh is the script the hosted instance
runs from cron to ship its encrypted dumps to Cloudflare R2 through rclone;
its header explains how to adapt it.
Restoring
Section titled “Restoring”-
Decrypt the dump on your machine:
Terminal window age -d -i loomkeep-backup-key.txt -o dump.sql backup-file.sql.age -
Restore it from Admin › Backup.
Without the admin panel
Section titled “Without the admin panel”Restoring from Admin › Backup needs an API that starts and an administrator who can sign in. When that’s exactly what’s broken (a failed upgrade, a lost database, a new server), restore from the command line.
-
Get a dump out of the server, if it’s still reachable. The nightly ones live in the
apicontainer:Terminal window docker compose exec api ls /data/backupsdocker compose cp api:/data/backups/loomkeep-….sql.age . -
Decrypt it on your machine, as above.
-
On a new server, clone the repository and put back your whole
.env, not a fresh one:MFA_ENCRYPTION_KEYdecrypts the authenticator-app secrets stored in the database,POSTGRES_PASSWORDand the JWT secrets must stay the same, andBACKUP_ENCRYPTION_PUBLIC_KEYkeeps the next backups readable with your key. -
Start the database alone, on an empty volume:
Terminal window docker compose up -d db -
Load the dump in one transaction, so a truncated file leaves the database empty rather than half restored (replace
loomkeepif you changedPOSTGRES_USERorPOSTGRES_DB):Terminal window docker compose exec -T db psql -U loomkeep -d loomkeep --set ON_ERROR_STOP=1 --single-transaction < dump.sql -
Start everything with an image at least as recent as the version the dump came from: the API applies the migrations the dump lacks when it starts, but an older image doesn’t know the newer tables.
Terminal window docker compose up -d -
Delete
dump.sql: it holds every account in clear.
Users’ own exports
Section titled “Users’ own exports”Each person can also take a full copy of their own data at any time: see Your data.