DEV Community

Cover image for Creating an AWS DMS Migration Task
Ismail G.
Ismail G.

Posted on

Creating an AWS DMS Migration Task

Migrating Data from Local SQL Server to AWS RDS PostgreSQL Using AWS DMS - II

In my last post, I guided you through building AWS Database Migration Service (DMS) to move data from an on-premises SQL Server to an AWS RDS PostgreSQL database instance. We went over establishing the AWS environment, configuring the source database, and building the required AWS DMS resources.

In this article, we will examine the migration process itself—target. With both source and target endpoints configured, the next step is to create a migration task in AWS DMS.

Creating and Running the AWS DMS Migration Task

With both the source (SQL Server) and target (PostgreSQL) endpoints configured (if not check the Migrating Data from Local SQL Server to AWS RDS PostgreSQL Using AWS DMS - I, it's time to create and execute a migration task.

Creating the Migration Task

1.Navigate to Database Migration Tasks:

Go to AWS DMS Console > Database migration tasks > Create task.

2.Configure Task Settings:
Image description

  • Task Identifier: Just give a name, for example, sqlserver-to-postgres-migration.
  • Replication instance: Select the replication instance configured earlier.
  • Source and target database: Choose the previously configured SQL Server source and PostgreSQL target endpoints.
  • Migration type: Select "Migrate" to perform a full load of the existing data.

3.Task Settings:

Image description

  • Editing mode: Wizard
  • Target table preparation mode: If you wish DMS to drop and replicate tables on the target, choose for "Drop tables on target". If you wish to maintain the current structure and data unaltered, then choose "Do nothing"; DMS just adds fresh entries without altering or deleting any current data. If you have pre-existing data that ought to be kept whole, this option is handy.
  • Include LOB columns in replication: Enable this option if your tables contain large object (LOB) data types.​
  • Enable validation: When you enable this option, AWS DMS verifies the row counts and checksums of the source and target databases and confirms that they are equal.

4.Table Mapping and Transformations

Image description

  • Editing mode: Wizard
  • Selection rules: Define at least one selection rule to specify the schemas and tables you want to be included or excluded from the migration. Use % in the Source table name to include all tables.
  • Transformation rules (optional): Set transformation rules, if you need to rename schemas, tables, or columns.

5.Premigration assessment

Image description
A premigration assessment warns you of potential migration issues before starting your migration task. For this tutorial I skipped premigration assessment.

6.Running the Migration Task

Click Create task, then Start the migration.

AWS DMS will begin extracting data from SQL Server, transforming it, and loading it into PostgreSQL.

Top comments (0)