<@U04S8PLJWMT> I want to migrate the airbyte appli...
# ask-ai
w
@kapa.ai I want to migrate the airbyte application databases including temporal and temporal visibility from AWS RDS Postgres to GCP CloudSQL Postgres. Using GCP or AWS DMS service has its own limitations as above databases have Generated columns are not supported for migration. (Due to Large Objects) Some table(s) have limited support. tables without primary keys were identified and only 'INSERT' statements will be replicated for these tables: How to migrate these databases safely without affecting source tables data to new destination?
k
To safely migrate the Airbyte application databases (including temporal and temporal_visibility) from AWS RDS Postgres to GCP CloudSQL Postgres, you should use a manual backup and restore approach, as Airbyte does not provide a built-in migration feature for its internal databases. Here’s how you can proceed, based on the available knowledge sources: ### 1. Manual Backup and Restore - Create the target databases on GCP CloudSQL: You need to manually create the
airbyte
,
temporal
, and
temporal_visibility
databases in your CloudSQL instance before restoring data.
Copy code
sql   CREATE DATABASE airbyte WITH OWNER = postgres;   CREATE DATABASE temporal WITH OWNER = postgres;   CREATE DATABASE temporal_visibility WITH OWNER = postgres;
Replace
postgres
with the appropriate database user if needed. - Backup each database from AWS RDS using `pg_dump`:
Copy code
bash   pg_dump -h <aws-rds-endpoint> -U <user> airbyte > airbyte.sql   pg_dump -h <aws-rds-endpoint> -U <user> temporal > temporal.sql   pg_dump -h <aws-rds-endpoint> -U <user> temporal_visibility > temporal_visibility.sql
- Restore each database to GCP CloudSQL using `psql`:
Copy code
bash   psql -h <cloudsql-endpoint> -U <user> -d airbyte -f airbyte.sql   psql -h <cloudsql-endpoint> -U <user> -d temporal -f temporal.sql   psql -h <cloudsql-endpoint> -U <user> -d temporal_visibility -f temporal_visibility.sql
This approach ensures a full logical backup and restore, preserving all data and schema as supported by Postgres. ### 2. Considerations and Limitations - Generated Columns & Large Objects: If your databases use generated columns or large objects, be aware that some migration tools (like DMS) may not support them. However,
pg_dump
and
psql
handle these features natively, so this manual approach avoids those tool-specific limitations. - Tables Without Primary Keys: Tables without primary keys will be fully copied, but incremental replication (CDC) is not supported for these tables in Airbyte. This is not an issue for a one-time migration using `pg_dump`/`psql`, but be aware if you plan to use CDC for ongoing syncs later. For CDC, only tables with primary keys are supported for incremental syncs; others require full refreshes or standard replication methods [see connector limitations](https://docs.airbyte.com/integrations/sources/postgres/postgres-troubleshooting#connector-limitations). - Downtime and Consistency: To avoid data inconsistency, consider scheduling a maintenance window. You may want to: 1. Take an initial backup and restore. 2. Stop writes to the source databases. 3. Take a final incremental backup (or a second full backup if incremental is not feasible). 4. Restore the final backup to the destination. - Version Compatibility: Ensure that the Postgres versions on AWS RDS and GCP CloudSQL are compatible. Mismatched versions can cause issues during restore [see user experience](https://github.com/airbytehq/airbyte/issues/49304). ### 3. Airbyte-Specific Notes - No Automatic Migration: Airbyte does not automatically migrate its internal databases. You must handle the backup and restore process manually [see forum post](https://discuss.airbyte.io/t/2903). - Schema and Indexes: The manual backup/restore process with `pg_dump`/`psql` will preserve schema, indexes, and constraints, unlike some sync tools that may only copy data [see user experience](https://github.com/airbytehq/airbyte/issues/49304). --- Summary: Use
pg_dump
and
psql
to manually backup and restore the
airbyte
,
temporal
, and
temporal_visibility
databases. This method avoids the limitations of DMS and similar tools regarding generated columns and large objects, and ensures a safe, consistent migration. Be sure to plan for downtime to maintain data consistency during the cutover. If you need to migrate data incrementally or keep both systems in sync for a period, you may need to explore more advanced replication strategies, but for a one-time migration, the above approach is recommended.