How do I use transformations in AWS Database Migration Service (AWS DMS) to modify a schema, table, or column?
You can use transformations to modify a schema, table, or column. For example, you can rename, add, replace, or remove a prefix or suffix for a table, or change the table name to uppercase or lowercase. You can define your transformation rules by using the AWS Command Line Interface (AWS CLI) or API, or by using the AWS DMS console.
Note: If you receive errors when running AWS CLI commands, make sure that you’re using the most recent version of the AWS CLI.
- Open the AWS DMS console, and then choose Database migration tasks from the navigation pane.
- Choose Create task.
- Enter the details for Task configuration and Task settings.
- Select Enable CloudWatch logs.
- From the Table mappings section, choose Guided UI. You can also choose JSON editor to enter the mappings in JSON format.
- Expand the Selection rules section, and then choose Add a new selection rule.
- Enter a Schema and Table name.
- From Action, select Include or Exclude.
Note: You can add multiple selection rules by choosing Add new selection rule and then entering the details for your selection rule. You must have at least one selection rule to use transformations.
- Expand the Transformation rules section, and then choose Add a new transformation rule.
- Choose a Target by selecting Schema, Table, or Column.
Note: If you choose Column, you must enter the Schema, Table, and Column names. If you choose Table, you must enter the Schema and Table names only. If you choose Schema, you must enter the Schema name only.
- From Action, select one of the following:
Remove column (Unavailable if you choose Schema or Table as the target)
- Choose Add a new transformation rule to save the transformation rule.
- Choose Create task.
To add transformations to a task that already exists, choose Database migration tasks from the navigation pane. Select your task, choose Actions, and then choose Modify. From the Table mappings section, expand Selection rules, and then choose Add new selection rule. To add more transformations, expand Transformation rules, choose Add a new transformation rule, and then choose Save.
For more information on how each of these transformation rules work (with examples), see Transformation rules and actions.