Backup & Recovery
Backup & Recovery
Section titled “Backup & Recovery”Protect your FlightStack data with regular backups.
What to Backup
Section titled “What to Backup”- PostgreSQL database - All configuration, pipelines, runs
- Artifacts (if using local storage) - Build outputs
- Configuration - .env file, secrets
Database Backup
Section titled “Database Backup”Manual Backup
Section titled “Manual Backup”# Dockerdocker-compose exec postgres pg_dump -U flightstack flightstack > backup.sql
# Directpg_dump -h localhost -U flightstack flightstack > backup.sqlRestore
Section titled “Restore”psql -h localhost -U flightstack flightstack < backup.sqlAutomated Backups
Section titled “Automated Backups”Set up a cron job:
0 2 * * * pg_dump -h localhost -U flightstack flightstack > /backups/flightstack-$(date +\%Y\%m\%d).sqlArtifact Backup
Section titled “Artifact Backup”If using local storage, backup the artifacts directory:
tar -czf artifacts-backup.tar.gz /var/flightstack/artifactsDisaster Recovery
Section titled “Disaster Recovery”- Provision new infrastructure
- Restore PostgreSQL from backup
- Restore artifacts
- Update DNS to point to new instance
- Re-register build agents