<@U04SE163WC8> how can i bakcup the connection dat...
# ask-ai
u
@kapa.ai how can i bakcup the connection data in airbyte and use it other server??
k
To back up your Airbyte connection data and use it on another server, you should back up the Airbyte internal Postgres database and restore it on the new server. This process will migrate your sources, destinations, connections, and stream states. Here’s a general outline based on the knowledge sources: ### 1. Backup the Airbyte Database - For Kubernetes deployments: - Get your database pod name (usually
airbyte-db-0
). - Run
pg_dump
inside the Postgres pod to create a backup:
Copy code
bash     kubectl exec -n <namespace> -it <database_pod> -- bash -c "pg_dump -U airbyte db-airbyte > /tmp/airbyte_backup.sql"
- Copy the backup file to your local machine:
Copy code
bash     kubectl cp <namespace>/<database_pod>:/tmp/airbyte_backup.sql ./airbyte_backup.sql
- For Docker deployments: - Stop all Airbyte services except the database. - Run:
Copy code
bash     docker exec airbyte-db pg_dump -U docker airbyte > airbyte_backup.sql
- Transfer the
airbyte_backup.sql
file to your new server. ### 2. Restore the Database on the New Server - For Kubernetes: - Copy the backup file into the new database pod:
Copy code
bash     kubectl cp ./airbyte_backup.sql <namespace>/<database_pod>:/tmp/airbyte_backup.sql
- Drop and recreate the schema (this erases all data in the database):
Copy code
bash     kubectl exec -n <namespace> -it <database_pod> -- bash -c "psql -U airbyte -d db-airbyte -c 'DROP SCHEMA public CASCADE; CREATE SCHEMA public;'"
- Restore the backup:
Copy code
bash     kubectl exec -n <namespace> -it <database_pod> -- bash -c "psql -U airbyte -d db-airbyte < /tmp/airbyte_backup.sql"
- For Docker: - On the new server, start only the database container. - Drop and recreate the database:
Copy code
bash     docker exec airbyte-db psql -U docker -c 'drop database airbyte';     docker exec airbyte-db psql -U docker -c 'create database airbyte with owner docker;'
- Restore the backup:
Copy code
bash     cat airbyte_backup.sql | docker exec -i airbyte-db psql -U docker -d airbyte
- Start all Airbyte services. Important: - Both Airbyte instances (old and new) should be running the same version to avoid compatibility issues. - This process will not migrate job sync history/logs or Temporal data unless you also back up and restore those databases if used. - After restoring, you may need to trigger all connections again to recreate Temporal workflows. For more details and step-by-step instructions, see the following sources: [How to import/export Airbyte to a new instance (docker to docker deploy)](https://discuss.airbyte.io/t/3514), [Upgrade to Helm chart V2 (Self-Managed Community)](https://docs.airbyte.com/platform/deploying-airbyte/chart-v2-community#how-to-upgrade), [Forum: Migrate Airbyte config from one deployment to another (OSS)](https://discuss.airbyte.io/t/370).
To back up your Airbyte connection data and use it on another server, the recommended approach is to back up the Airbyte internal Postgres database and restore it on the new server. Here’s a general outline of the process: ### 1. Backup the Airbyte Database - For Kubernetes deployments: - Get your database pod name (usually
airbyte-db-0
):
Copy code
kubectl get pods --all-namespaces | grep db
- Run
pg_dump
inside the Postgres pod:
Copy code
kubectl exec -n <namespace> -it <database_pod> -- bash -c "pg_dump -U airbyte db-airbyte > /tmp/airbyte_backup.sql"
- Copy the backup to your local machine:
Copy code
kubectl cp <namespace>/<database_pod>:/tmp/airbyte_backup.sql ./airbyte_backup.sql
[How to upgrade - Airbyte Docs](https://docs.airbyte.com/platform/deploying-airbyte/chart-v2-community#how-to-upgrade) - For Docker deployments: - Stop all services except the database:
Copy code
docker-compose down     docker-compose up -d db
- Create the backup:
Copy code
docker exec airbyte-db pg_dump -U docker airbyte > airbyte_backup.sql
[How to import/export Airbyte to a new instance (docker to docker deploy)](https://discuss.airbyte.io/t/3514) ### 2. Restore the Database on the New Server - For Kubernetes: - Copy the SQL backup file into your pod:
Copy code
kubectl cp ./airbyte_backup.sql <namespace>/<database_pod>:/tmp/airbyte_backup.sql
- Drop and recreate the schema (this erases all data in the database):
Copy code
kubectl exec -n <namespace> -it <database_pod> -- bash -c "psql -U airbyte -d db-airbyte -c 'DROP SCHEMA public CASCADE; CREATE SCHEMA public;'"
- Restore the database:
Copy code
kubectl exec -n <namespace> -it <database_pod> -- bash -c "psql -U airbyte -d db-airbyte < /tmp/airbyte_backup.sql"
[Deploy Airbyte - Airbyte Docs](https://docs.airbyte.com/platform/deploying-airbyte/chart-v2-community#deploy-airbyte) - For Docker: - On the new server, start only the database:
Copy code
docker-compose up -d db
- Drop and recreate the database:
Copy code
docker exec airbyte-db psql -U docker -c 'drop database airbyte';     docker exec airbyte-db psql -U docker -c 'create database airbyte with owner docker;'
- Restore the backup:
Copy code
cat airbyte_backup.sql | docker exec -i airbyte-db psql -U docker -d airbyte
- Start Airbyte:
Copy code
docker-compose up -d
[How to import/export Airbyte to a new instance (docker to docker deploy)](https://discuss.airbyte.io/t/3514) ### Important Notes - Version Compatibility: Both Airbyte instances (source and target) should be running the same version to avoid compatibility issues. - State and Logs: This method preserves connection states and job history. If you use the API to recreate connections, you may lose incremental sync state and job logs. - Cloud Migration: If you are migrating from OSS to Airbyte Cloud, direct import/export is not currently supported; you must recreate connectors manually in the Cloud UI [Migrate from Airbyte OSS to Airbyte Cloud Questions](https://discuss.airbyte.io/t/130). If you need to migrate only configuration (not the full database), Airbyte does not currently provide a built-in migration feature for this purpose, so database backup/restore is the most complete method available.