Skip to content

Backup & restore

A ReplayVOD install has three things worth backing up.

server/.env

Secrets used to encrypt sessions and verify webhook HMACs. Tiny, irreplaceable.

Database

SQLite file or Postgres DB. Holds schedules, video metadata, segment state, sessions.

Media

VIDEO_DIR and THUMBNAIL_DIR. Usually the largest data set.

Stop the recorder before copying the file — SQLite write-ahead-log files don’t copy atomically with cp.

Terminal window
docker compose stop replayvod
cp data/replayvod.db /backup/replayvod-$(date +%F).db
docker compose start replayvod

Or use Litestream for continuous replication without stopping the recorder.

Use your normal Postgres tooling:

Terminal window
pg_dump -h localhost -U postgres replayvod > /backup/replayvod-$(date +%F).sql

VIDEO_DIR and THUMBNAIL_DIR are plain files. Any file-level backup tool works (restic, rsync, your filesystem snapshot tool, etc.).

Recordings are immutable once finalised, so incremental backups are efficient — only newly-finished VODs change between runs.

If you store media in S3, the bucket itself is your backup; replicate it to a second region or provider if you want belt-and-braces.

To restore a full install on a new host:

  1. Re-run the installer on the new host to lay down the directory structure.
  2. Copy the saved server/.env over the freshly-generated one.
  3. Restore the database (cp the SQLite file, or psql < dump.sql).
  4. Restore VIDEO_DIR and THUMBNAIL_DIR.
  5. Start the stack — migrations will no-op against an already-current schema.