/ opencodehub / docs / administration / backup-restore.md
Swadhin Biswas Feature/ai code reviewer (#73) · 8/2/2026
105a287
30 lines · 953 Bytes
Raw Download

Backup and Restore

This guide covers how to back up and restore an OpenCodeHub instance.

Backup Strategy

1. Database

For PostgreSQL, use pg_dump:

pg_dump -U opencodehub -d opencodehub_db > opencodehub_backup.sql

2. Git Repositories

The Git repositories are stored in the path defined by GIT_REPOS_PATH (default: ./data/repos).
You can back this up using rsync or tar:

tar -czvf repos_backup.tar.gz ./data/repos/

3. Object Storage

If you are using S3 or another object storage provider for artifacts, ensure you have enabled versioning and standard bucket backups through your cloud provider. If using local storage, back up the configured ./data/storage directory.

Restore Strategy

To restore:

  1. Stop the application and worker processes.
  2. Restore the database using psql.
  3. Extract the Git repositories to GIT_REPOS_PATH.
  4. Restore object storage data.
  5. Restart the application.