Migrating your source schema to your target database using AWS SCT
In this section, you use the AWS Schema Conversion Tool to migrate your source schema to your target database. Alternatively, you can use DMS Schema Conversion to convert your source database schemas. For more information, see Getting started with DMS Schema Conversion.
To migrate your source schema to your target database with AWS SCT
Install the AWS Schema Conversion Tool. For more information, see Installing, verifying, and updating the AWS SCT in the AWS Schema Conversion Tool User Guide.
When you download JDBC drivers for MySQL and PostgreSQL, note where you save the drivers, in case the tool prompts you for their locations.
Open the AWS Schema Conversion Tool. Choose File, then choose New project.
In the New project window, set the following values:
Set Project name to
DMSProject
.Keep Location as it is to store your AWS SCT project in the default folder.
Choose OK.
-
Choose Add source to add a source MySQL database to your project, then choose MySQL, and choose Next.
In the Add source page, set the following values:
Connection name:
source
Server name: Enter the endpoint for the MySQL database that you noted previously.
Server port:
3306
User name:
admin
Password:
changeit
-
Choose Add target to add a target Amazon RDS for PostgreSQL database to your project, then choose Amazon RDS for PostgreSQL. Choose Next.
In the Add target page, set the following values:
Connection name:
target
Server name: Enter the endpoint for the PostgreSQL database that you noted previously.
Server port:
5432
Database: Enter the name of your PostgreSQL database.
User name:
postgres
Password:
changeit
In the left pane, choose dms_sample under Schemas. In the right pane, choose your target Amazon RDS for PostgreSQL database. Choose Create mapping. You can add multiple mapping rules to a single AWS SCT project. For more information about mapping rules, see Creating mapping rules.
Choose Main view.
In the left pane, choose dms_sample under Schemas. Open the context (right-click) menu and choose Convert schema. Confirm the action.
After the tool converts the schema, the dms_sample schema appears in the right pane.
In the right pane, under Schemas, open the context (right-click) menu for dms_sample and choose Apply to database. Confirm the action.
Verify that the schema migration completed. Perform the following steps.
To check your schema migration
Connect to your Amazon EC2 client.
Start the PSQL client with the following command. Specify your PostgreSQL database endpoint, and provide the database password when prompted.
psql \ --host=dms-postgresql.
abcdefg12345
.us-west-2.rds.amazonaws.com \ --port=5432 \ --username=postgres \ --password \ --dbname=dms_sampleQuery one of the (empty) tables to verify that AWS SCT applied the schema correctly,
dms_sample=> SELECT * from dms_sample.player; id | sport_team_id | last_name | first_name | full_name ----+---------------+-----------+------------+----------- (0 rows)