Backup & Restore

What to back up, how to restore it, and how to avoid losing encrypted data.

What to back up

DataWhere it livesCriticality
Playbooks, inventories, executionsPostgreSQLHigh
SSH keys and vault passwordsPostgreSQL, encryptedHigh
ENCRYPTION_KEYDeployment secretsCritical
AUTH_SECRETDeployment secretsHigh
Deployment configCompose/Coolify/project settingsHigh
Danger
A database backup without the matching ENCRYPTION_KEY cannot recover encrypted credentials.

Backing up PostgreSQL

Docker Compose

bash
docker compose exec postgres pg_dump -U postgres sculptops > backup.sql

External PostgreSQL

bash
pg_dump "$DATABASE_URL" > backup.sql

Backing up secrets

Store production secrets in a deployment secret manager. At minimum, preserve ENCRYPTION_KEY, AUTH_SECRET, and the database connection configuration.

Restoring

  1. Stop the application service.
  2. Restore the PostgreSQL backup.
  3. Restore the same deployment secrets, especially ENCRYPTION_KEY.
  4. Start the application service.
  5. Verify that playbooks, inventories, SSH key names, and execution history are visible.
Warning
Do not run two production instances against the same database unless you have planned the migration carefully.