<@U04S8PLJWMT> I have an Self-Managed Community Ai...
# replication-ask-ai
j
@kapa.ai I have an Self-Managed Community Airbyte 1.8.1 K8S installation and after using it as is I want to export the internal postgres database to a external one, hosted on one of my network machines. What are the necessary steps to export the internal database with all of the configurations and connections I already have and then point Airbyte to start reading and writing on this external db?
k
You’ll need to do this in two phases: 1. Back up the existing internal Postgres DB 2. Restore it into your external Postgres instance and reconfigure Helm to use it There is no built‑in migration/auto‑copy feature; you must do this manually.[[External PG forum](https://discuss.airbyte.io/t/2903)] --- ## 1. Back up the internal Postgres database Your internal DB is running in a pod (commonly
airbyte-db-0
) and the main Airbyte DB name is typically
db-airbyte
(for K8s). The docs show how to back this up with
pg_dump
from inside the pod.[[Upgrade v2 1.8](https://docs.airbyte.com/platform/1.8/deploying-airbyte/chart-v2-community#how-to-upgrade)] 1. Find the DB pod:
Copy code
bash    kubectl get pods -n <namespace> | grep db    # likely airbyte-db-0
2. Run
pg_dump
inside that pod:
Copy code
bash    kubectl exec -n <namespace> -it <database_pod> -- bash -c \      "pg_dump -U airbyte db-airbyte > /tmp/airbyte_backup.sql"
3. Copy the dump file locally:
Copy code
bash    kubectl cp <namespace>/<database_pod>:/tmp/airbyte_backup.sql ./airbyte_backup.sql
Safeguard this file; it contains all your configs, connections, and state.[[Upgrade v2 1.8](https://docs.airbyte.com/platform/1.8/deploying-airbyte/chart-v2-community#how-to-upgrade)] > Note: Some older guidance and GitHub issues mention separate
airbyte
,
temporal
, and
temporal_visibility
DBs.[[External PG issue](https://github.com/airbytehq/airbyte/issues/49304)] > For your current K8s 1.8.x installation, follow what you actually see in your cluster (usually just
db-airbyte
for community). --- ## 2. Prepare the external Postgres and restore On your external Postgres host: 1. Create the target database and user (example):
Copy code
sql    CREATE DATABASE airbyte WITH OWNER airbyte;    -- or equivalent, matching the user you will configure in Helm
2. Restore from the dump:
Copy code
bash    psql -h <external-db-host> -U <external-user> -d airbyte -f ./airbyte_backup.sql
Adjust host, user, database name, and port to your environment. --- ## 3. Configure Airbyte to use the external database For Self‑Managed Community 1.8.x on K8s, you must: 1. Create the secret with DB credentials (as recommended):[[DB integration 1.8](https://docs.airbyte.com/platform/1.8/deploying-airbyte/integrations/database#secrets)]
Copy code
yaml    apiVersion: v1    kind: Secret    metadata:      name: airbyte-config-secrets    type: Opaque    stringData:      database-user: "<db-user>"        # e.g. airbyte      database-password: "<db-password>"
Apply it:
Copy code
bash    kubectl apply -n <namespace> -f airbyte-config-secrets.yaml
2. Update your
values.yaml
to disable internal Postgres and point to external
.[[DB integration 1.8](https://docs.airbyte.com/platform/1.8/deploying-airbyte/integrations/database#values)] For Helm chart v1:
Copy code
yaml    postgresql:      enabled: false     global:      database:        type: external        secretName: "airbyte-config-secrets"        host: "<external-db-host>"        port: "<external-db-port>"        database: "airbyte"          # or the name you restored into        userSecretKey: "database-user"        passwordSecretKey: "database-password"
For Helm chart v2, the main change is the key
name
instead of `database`:[[DB integration 1.8](https://docs.airbyte.com/platform/1.8/deploying-airbyte/integrations/database#values)]
Copy code
yaml    postgresql:      enabled: false     global:      database:        type: external        secretName: "airbyte-config-secrets"        host: "<external-db-host>"        port: "<external-db-port>"        name: "airbyte"        userSecretKey: "database-user"        passwordSecretKey: "database-password"
3. Apply the Helm upgrade:
Copy code
bash    helm upgrade airbyte <chart-repo/airbyte> \      -n <namespace> \      -f values.yaml
Airbyte will now read/write from the external Postgres using the restored data. --- ## 4. Things to be aware of - There is no automatic “copy” from internal to external DB; the manual dump/restore you did is the correct and required path.[[External PG forum](https://discuss.airbyte.io/t/2903)] - Ensure the Airbyte version remains the same across backup and restore to avoid schema mismatches (a general recommendation shown in similar DB migration guides).[[Import/export forum](https://discuss.airbyte.io/t/3514)] - Test the new setup in a separate namespace first if possible (similar to how the upgrade docs recommend using a new namespace when using an external DB).[[Upgrade v2 1.8](https://docs.airbyte.com/platform/1.8/deploying-airbyte/chart-v2-community#how-to-upgrade)] If you share your Helm chart version (v1 vs v2) and namespace name, I can help you refine the exact
values.yaml
snippet.