Skip to content
Lore
Lore
Install LoreOpen the demo

Backup and restore

Two things to back up: the PostgreSQL database and the imported files. Keep your settings too: the .env file with Docker, lore.env otherwise.

Documentation for version 0.1, in preparation. Commands, variables and API endpoints are proposals: they may change before the release.

On this page

Back up

Terminal
# Database, in pg_dump's custom format
docker compose exec -T postgres pg_dump -U lore -Fc lore > lore-$(date +%F).dump

# Imported files
docker run --rm -v lore_files:/data -v "$PWD":/backup alpine \
  tar czf /backup/files-$(date +%F).tar.gz -C /data .

With Docker, the volume name depends on the Docker Compose project folder: check it with docker volume ls. If PostgreSQL runs on another server, add the -h (host) and -U lore options to pg_dump.

Restore

  1. Stop the application

    Terminal
    docker compose stop lore
  2. Restore the database

    Terminal
    docker compose exec -T postgres pg_restore -U lore -d lore --clean --if-exists < lore-2026-11-10.dump
  3. Restore the files

    Terminal
    docker run --rm -v lore_files:/data -v "$PWD":/backup alpine \
      tar xzf /backup/files-2026-11-10.tar.gz -C /data
  4. Start again

    Terminal
    docker compose start lore

Test your restores. A backup that was never restored is only a hypothesis. Restore regularly on a test machine.