Backup Procedures
Database, file storage, and Kubernetes backup requirements
This guide outlines backup requirements and recommendations for the application.
Overview
Backup Strategy: Recommended weekly backups with monthly archives
Retention Policy (Recommended):
- Weekly backups: 4 weeks
- Monthly backups: Per organizational policy
Components to Backup:
- PostgreSQL Database
- File Storage
- Environment Configuration
- Kubernetes Resources
1. PostgreSQL Database Backup
Responsibility: Organization maintains database backups using their existing backup infrastructure and procedures.
Recommended Tools: pg_dump or your organization's existing database backup solution
Database Connection: Available via DATABASE_URL environment variable
Manual Backup Commands
Create a backup of the current database:
kubectl exec -n <namespace> deployment/chatbot-web -- bash -c 'pg_dump $DATABASE_URL' > backup.pgdumpRestore database from backup file (this will overwrite the current database contents!):
kubectl exec -i -n <namespace> deployment/chatbot-web -- bash -c 'psql $DATABASE_URL' < backup.pgdump2. File Storage Backup
Responsibility: Organization maintains file storage backups using their existing backup infrastructure and procedures.
3. Environment Configuration Backup
Responsibility: Organization securely stores environment configuration outside the application system.
Requirements: Store all environment variables, ConfigMaps, and Secrets in secure, encrypted location separate from application infrastructure.
4. Kubernetes Resources Backup
Responsibility: Organization maintains Kubernetes cluster backups using their existing infrastructure backup procedures.
Recommended Tools: Velero, cloud provider backup services, or manual YAML exports