Migrating your source schema to your target database using AWS SCT - AWS Database Migration Service

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
  1. 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.

  2. Open the AWS Schema Conversion Tool. Choose File, then choose New project.

  3. 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.

  4. Choose Add source to add a source MySQL database to your project, then choose MySQL, and choose Next.

  5. 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

  6. Choose Add target to add a target Amazon RDS for PostgreSQL database to your project, then choose Amazon RDS for PostgreSQL. Choose Next.

  7. 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

  8. 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.

  9. Choose Main view.

  10. 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.

  11. 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
  1. Connect to your Amazon EC2 client.

  2. 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_sample
  3. Query 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)