Wasim Bagwan
08/02/2025, 4:53 PMkapa.ai
08/02/2025, 4:54 PMairbyte, temporal, and temporal_visibility databases in your CloudSQL instance before restoring data. 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`: 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`: 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.