Overview
All Omni data is stored in PostgreSQL. Backing up your database ensures you can recover:
- User accounts and settings
- Connector configurations
- Indexed documents and search index
- Chat history
Backup
Docker Compose
If you haven’t already, set up the alias:
alias omni-compose="docker compose -f docker/docker-compose.yml --env-file .env"
omni-compose exec postgres pg_dump -U omni omni | gzip > backup_$(date +%Y%m%d).sql.gz
Postgres runs as an ECS task. Use ECS Exec to run the backup:
aws ecs execute-command --cluster omni --task <postgres-task-id> \
--container postgres --interactive \
--command "pg_dump -U omni omni" | gzip > backup_$(date +%Y%m%d).sql.gz
Restore
Docker Compose
gunzip < backup.sql.gz | omni-compose exec -T postgres psql -U omni omni
gunzip < backup.sql.gz | aws ecs execute-command --cluster omni --task <postgres-task-id> \
--container postgres --interactive \
--command "psql -U omni omni"
Restoring will overwrite existing data. Stop all Omni services before restoring.
Recommendations
- Daily backups for production instances
- Test restores periodically to verify backup integrity
- Store backups offsite or in a different region than your primary deployment