Backup Strategy
Security · 5 min
Backups are your insurance policy. Heres how to backup your AI stack properly.
3-2-1 Rule
- 3 copies of data
- 2 different storage types
- 1 copy offsite
What to Backup
| Service | Data | Priority |
|---|---|---|
| PostgreSQL | Database dumps | Critical |
| Ollama | Models (~4GB each) | High |
| n8n | Workflows JSON | High |
| Docker configs | docker-compose.yml | Medium |
Backup Script
#!/bin/bash
DATE=$(date +%Y%m%d_%H%M)
# PostgreSQL
docker exec postgres pg_dump -U user db > backup_$DATE.sql
# n8n
tar czf n8n_$DATE.tar.gz ./n8n-data
# Ollama models
tar czf ollama_$DATE.tar.gz /var/lib/ollama
# Upload to remote
rclone copy . remote:backups/$DATE/
# Keep only 7 days locally
find . -name "*.sql" -mtime +7 -deleteCron Schedule
# /etc/cron.d/backup
# Daily at 2am
0 2 * * * root /opt/scripts/backup.shRecovery Test
- Test restore quarterly
- Document recovery steps
- Verify backups are complete
- Test with team
Next step: move from knowledge to implementation
If you want more than theory: setups, workflows and templates from real operations for teams that want local, documented AI systems.
Why AI Engineering
- Local and self-hosted by default
- Documented and auditable
- Built from our own runtime
- Made in Austria
Not legal advice.