Backup and restore procedures for strut databases (Postgres, Neo4j, MySQL, SQLite) using strut. Use when backing up data, restoring from backups, or managing database snapshots.
Backup and restore procedures for strut databases (Postgres, Neo4j, MySQL, SQLite) using strut.
# Backup Postgres (my-stack)
strut my-stack backup postgres --env prod
# Backup Neo4j (my-stack)
strut my-stack backup neo4j --env prod
# Backup MySQL (docspace)
strut docspace backup mysql --env docspace-prod
# Backup SQLite (jitsi)
strut jitsi backup sqlite --env jitsi-prod
# Backup all enabled targets for a stack
strut my-stack backup all --env prod
# Pull and restore all databases
strut my-stack db:pull --env prod
# Pull specific database type
strut my-stack db:pull postgres --env prod
# Download only (no restore)
strut my-stack db:pull --env prod --download-only
# Push and restore Postgres (⚠️ overwrites production data)
strut my-stack db:push postgres --env prod --file backups/postgres-20260303-143022.sql
# Preview first with --dry-run
strut my-stack db:push postgres --env prod --file backups/postgres.sql --dry-run
| Stack | Postgres | Neo4j | MySQL | SQLite | VPS |
|---|---|---|---|---|---|
| my-stack | ✅ | ✅ | — | — | 164.92.160.148 |
| docspace | — | — | ✅ (8.3.0) | — | 83.228.220.209 |
| jitsi | — | — | — | ✅ | 83.228.221.129 |
Notes:
onlyoffice-mysql-serverBACKUP_SQLITE_USE_DOCKER=true in backup.conf)VPS_SUDO=yes require VPS_SUDO=true in their env file# Verify a specific backup
strut my-stack backup verify backups/postgres-20260315-020000.sql --env prod
# Verify all backups in a stack
strut my-stack backup verify-all --env prod
# View health scores (0-100)
strut my-stack backup health --env prod
Each stack has a backup.conf controlling schedules and retention:
# strut/stacks/<stack>/backup.conf
BACKUP_POSTGRES=true
BACKUP_SCHEDULE_POSTGRES="0 2 * * *" # 02:00 UTC daily
BACKUP_RETAIN_DAYS=30
BACKUP_RETAIN_COUNT=10
strut my-stack backup schedule install-defaults --env prod
strut my-stack backup schedule list --env prod
strut my-stack backup cleanup --env prod
strut my-stack db:pull --env prod
strut my-stack db:pull --env prod
strut my-stack migrate neo4j --up --env prod
# Test, then apply to prod:
strut my-stack migrate neo4j --up --env prod
strut my-stack db:pull postgres --env prod --file postgres-20260303-143022.sql
strut my-stack migrate neo4j --down 1 --env prod
strut my-stack health --env prod
strut migrate for new VPS)VPS_SUDO=true in env file for stacks requiring sudo Docker access.prod.env, .jitsi-prod.env, etc.) with VPS connection detailsstrut my-stack exec "df -h /" --env prod # Check disk space
strut my-stack exec "docker compose --project-name prod exec postgres pg_isready" --env prod
strut my-stack shell --env prod # Check SSH access
grep VPS_HOST strut/.prod.env # Check VPS_HOST
strut/lib/backup.sh — Main backup scriptstrut/lib/backup/ — DB-specific backup implementations