AWS DMS Migration Task Fails with "No Tables Found" Using Wildcard in Table Mapping for MySQL

265 views Asked by At

I'm working on a project to migrate approximately 1000 databases from an RDS MySQL 5.7 instance to an RDS MySQL 8 instance using AWS Database Migration Service (DMS). All these databases have names starting with the prefix company_. There are a lot of other databases, so including all and excluding them one by one is not the option for me.

However, I'm facing an issue with the DMS migration task where it fails with the error message:

"No tables were found at task initialization. Either the selected table(s) or schemas(s) no longer exist or no match was found for the table selection pattern(s)."

This occurs when I try to use a selection rule in my table mappings to include all databases with the company_ prefix. The table mapping pattern I'm using is:

{
  "rule-type": "selection",
  "rule-id": "1",
  "rule-name": "1",
  "object-locator": {
    "schema-name": "company[_]%",
    "table-name": "%"
  },
  "rule-action": "include"
}

Interestingly, when I specify a single database like company_test-company, or even company_test% or company_t% the migration completes successfully. However, the issue arises when I use the wildcard pattern to include all company_ prefixed databases. I've also tried variations like company[_][a-z]%, company#_% and company% but all of them result in the same error.

From my understanding, the issue seems related to escaping the underscore in the pattern, but I can't seem to resolve it. The table mapping has to include all tables (%), so I'm a bit stuck on how to correctly format this wildcard pattern for AWS DMS.

My Setup:

  • Source: RDS MySQL 5.7 (using the root user account)
  • Target: RDS MySQL 8 (using the root user account)
  • DMS Instance: dms.c5.4xlarge

Has anyone encountered a similar issue or can provide insight into how to correctly escape the underscore in this context? Any suggestions or alternative approaches to correctly include all databases with the company_ prefix in the AWS DMS migration task would be greatly appreciated.

0

There are 0 answers