Skip to content

Database dump ​

The utilities are described in the PostgreSQL 15 documentation. The commands below are for a Standalone installation (PostgreSQL in the flip-postgres container). In an HA installation, run pg_dump/pg_restore directly on the PostgreSQL server.

Creating a dump ​

Run the commands from the deploy/docker-compose directory; the credentials are taken from the container's environment variables.

bash
docker compose exec flip-postgres sh -c 'PGPASSWORD="$POSTGRES_PASSWORD" pg_dump -U "$POSTGRES_USER" -d "$POSTGRES_DB" -F c -f /backup.dump'
docker compose cp flip-postgres:/backup.dump ./backup.dump

The result is a backup.dump file in the current directory.

Backups

A database dump does not include the files in S3 storage. A full backup of a Standalone installation means archiving the PostgreSQL, Valkey and MinIO volumes as described in the migration guide.

Restoring from a dump ​

  1. Stop the application services:
    bash
    docker compose stop flip-backend flip-mcp-server flip-file-handlers
  2. Copy the dump into the container and restore the database:
    bash
    docker compose cp ./backup.dump flip-postgres:/backup.dump
    docker compose exec flip-postgres sh -c 'PGPASSWORD="$POSTGRES_PASSWORD" pg_restore -U "$POSTGRES_USER" -d "$POSTGRES_DB" --clean --if-exists /backup.dump'
  3. Start the application:
    bash
    docker compose up -d

Versions

A dump is restored to the same application version it was created on.

flip on-premise and cloud documentation