跳至内容

AWS Postgresql DB clone

0

Hello,

I want to clone a postgres database in my AWS environment using DMS. I do see that using psql/pg_dump seems to be the best way since i only want to copy certain tables but I don't have access to the access to the server hence cannot run psql. In DMS i only see three options (Full Load, Full load CDC, and CDC). None of these options allow me to select tables that i want to copy. Can someone please guide me on how to achieve this partial clone?

Thanks!

已提问 6 个月前78 查看次数
2 回答
0

While AWS Database Migration Service (DMS) is a powerful tool for database migration and replication, it doesn't directly provide a way to clone only specific tables from a PostgreSQL database without access to the source server. However, you can still achieve a partial clone using DMS with some additional configuration.

To clone specific tables using DMS, you can follow these steps:

  1. Set up a DMS task with either Full Load or Full Load + CDC option, depending on your requirements.

  2. Use table mapping rules in your DMS task to include only the specific tables you want to clone. This allows you to selectively migrate only the desired tables.

  3. In the task settings, you can use the "Table-Level Settings" to further customize how each table is handled during the migration.

  4. If you need to capture schema changes (DDL) for these specific tables, ensure that the "CaptureDdls" option is enabled in your task settings.

  5. Monitor the task progress and verify that only the selected tables are being migrated.

By configuring the table mapping rules, you can effectively create a partial clone of your PostgreSQL database, including only the tables you specify. This approach allows you to achieve your goal of copying certain tables without direct access to the source server or using psql/pg_dump.

Keep in mind that while this method works, it may not be as efficient as a direct pg_dump for very large databases or if you need to frequently refresh the clone. If possible, working with your database administrators to gain limited access for running pg_dump might be more efficient for regular partial cloning operations.

Remember to test this approach in a non-production environment first to ensure it meets your specific requirements and doesn't impact the source database performance.
Sources
Find a way to only capture the DDL's in DMS to a CSV file | AWS re:Post
PostgreSQL Migration and CDC best approach | AWS re:Post

已回答 6 个月前
  • there is no option for using table mapping rules in my DMS task.

0

Hello, Have you tried to follow this documentation https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TableMapping.Console.html ?

Screen shot may be needed to show where you are stuck at ?

AWS
已回答 5 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。