Configure the Target Database


During the full load process, AWS DMS does not load tables in any particular order, so it might load the child table data before parent table data. As a result, foreign key constraints might be violated if they are enabled. Also, if triggers are present on the target database, they might change data loaded by AWS DMS in unexpected ways. To overcome this, we drop the constraints on the target database.

  1. Open pgAdmin 4 from the Taskbar on the EC2 server.

\[SqlDms03\]

  1. You may be prompted to set a Master Password. Enter dbmaster123, then click, OK.

\[SqlDms03\]

  1. Click on the Add New Server icon, and enter the following values. Then, press Save.
Parameter Value
General -> Name Target Aurora RDS (PostgreSQL)
Connection -> Host Name/Address < TargetAuroraPostgreSQLEndpoint >
Connection -> Port 5432
Connection -> Username dbmaster
Connection -> Password dbmaster123
Connection -> Save Password Check

\[SqlDms03\]

  1. Right-click on AuroraDB database from left-hand menu, and then select Query Tool.

\[SqlDms03\]

  1. In this step you are going to drop the foreign key constraint from the target database:

    1. Open DropConstraintsPostgreSQL.sql in your favorite text editor.
    2. Copy the content of the file to the Query Editor in pgAdmin 4.
    3. Execute the script.

\[SqlDms03\]