We were looking to combine data from multiple clients in Aurora MySQL into one table in Redshift for data analytics, just like you are.
We solved this by setting up a DMS task with a transformation rule to rename the schema to the same name for each client:
{
"rule-id": "1",
"rule-type": "transformation",
"rule-name": "rename-schema",
"rule-action": "rename",
"rule-target": "schema",
"object-locator": {
"schema-name": <client-schema-name>,
},
"value": "combined_data"
}
and then setting DMS Task Target table preparation mode
to Do nothing
to avoid there being a race condition between the clients to clear out the table before starting the migration task.
We also added the client
as a new column by adding a transformation rule to each table:
{
"rule-id": "2",
"rule-type": "transformation",
"rule-name": "add-client-column",
"rule-action": "add-column",
"rule-target": "column",
"object-locator": {
"schema-name": <client-schema-name>,
"table-name": <table-name>,
},
"value": "client",
"data-type": {
"type": "string",
"length": 255
},
"expression": "'<client-schema-name>'"
}
https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.Creating.html