Disaster Recovery
This guide outlines a conservative recovery strategy that works across storage backends.
1) Back up the database
Section titled “1) Back up the database”Use your database’s native backup tooling to snapshot the OpenCodeHub database. Examples:
- PostgreSQL:
pg_dump - MySQL:
mysqldump
2) Back up Git data and storage
Section titled “2) Back up Git data and storage”Back up the directories used by your instance:
GIT_REPOS_PATH(default./data/repositories)STORAGE_PATH(default./data/storage)
If you use S3/R2/MinIO, snapshot the bucket or enable versioning.
3) Restore
Section titled “3) Restore”- Restore the database backup.
- Restore repository and storage data to the configured paths.
- Run migrations to match the code version:
npm run db:migrate4) Validate
Section titled “4) Validate”- Open the UI and check a repository.
- Confirm that PRs, issues, and CI history load.
- Perform a test clone to verify Git data integrity.
5) Automate
Section titled “5) Automate”Use a scheduled backup job and store snapshots off‑site.