Skip to content

Backup reference

What is set where

Everything about backups, data retention and the package repository is managed in the console (Settings, Backup, Settings, Data retention, Software, Packages), except:

Setting Where Why not in the console
LIMDM_SESSION_KEY environment bootstrap secret; it opens the sealed values the console itself needs
age private key offline, -identity of the CLI must never reach the server
restore, restore test, verify with decryption limdm-server backup CLI need the age private key; a restore runs while no console exists
restore window restore -window belongs to the restore, which runs on the command line
-replay file restore -replay the audit copy is read on the restore host
scheduling restore-test cron or a systemd timer on a host with the age key the server never holds the key
LIMDM_ARTIFACT_DIR environment a server file system path; letting the console choose paths for server writes would let an admin account write anywhere the service user may
TMPDIR environment where the process stages files; a property of the host or container
LIMDM_SKIP_UPGRADE_BACKUP environment of apt or dnf read by the package script, before the new server exists

Command line

limdm-server backup [-env FILE] create [-reason TEXT] [-if-configured]
limdm-server backup [-env FILE] list [-from TARGET]
limdm-server backup [-env FILE] verify  -identity KEY [-from TARGET] [-command-key HEX] FILE
limdm-server backup [-env FILE] restore -identity KEY [-from TARGET] [-command-key HEX] [-db URL] [-ca DIR] [-window 168h] [-replay FILE] [-force] FILE
limdm-server backup [-env FILE] restore-test -identity KEY [-from TARGET] [-command-key HEX] [-db SCRATCH_URL] FILE

FILE is a local archive, or with -from the archive name on a configured target.

verify decrypts the archive, checks every entry against the manifest and the manifest signature, and prints the signing command key. Pass the expected key with -command-key (or run it on the server, which compares with its active key): age alone does not prove who wrote an archive, the signature does. restore and restore-test refuse an archive whose signer is neither -command-key nor the active command key of the server they run on.

Docker

The compose example keeps the CA directory and local uploads in the state volume; both are inside every archive. The image is read only, so archives are staged in TMPDIR, which the compose file points at the state volume. A local target must be a mounted volume:

  limdm:
    environment:
      TMPDIR: /var/lib/limdm-server
    volumes:
      - state:/var/lib/limdm-server
      - ./backups:/backups          # local target directory /backups

Create the host directory for the nonroot container user first: mkdir backups && sudo chown 65532 backups. Copy it off the host, or prefer an S3, B2, SFTP or WebDAV target.

The image contains everything a backup needs (no pg_dump). Restore with docker compose run --rm limdm backup restore ... against the new, empty database.