Backup and Restore Runbook¶
Overview¶
This runbook provides step-by-step procedures for backing up and restoring BlackLake data.
Backup Procedures¶
Database Backup¶
# Create database backup
pg_dump -h localhost -U blacklake -d blacklake > backup_$(date +%Y%m%d_%H%M%S).sql
# Compress backup
gzip backup_*.sql
S3 Storage Backup¶
# Sync S3 bucket to backup location
aws s3 sync s3://blacklake-storage s3://blacklake-backup/$(date +%Y%m%d)/
Redis Backup¶
Restore Procedures¶
Database Restore¶
# Restore from backup
gunzip -c backup_20240101_120000.sql.gz | psql -h localhost -U blacklake -d blacklake
S3 Storage Restore¶
Redis Restore¶
# Stop Redis
systemctl stop redis
# Copy backup file
cp /backup/redis_20240101_120000.rdb /var/lib/redis/dump.rdb
# Start Redis
systemctl start redis
Verification¶
- Verify database connectivity
- Check S3 bucket contents
- Test Redis operations
- Run health checks