Search code examples
amazon-rdsaws-dms

Error in AWS Schema Conversion Tool - Invalid Table Mappings document


I am trying to create a DMS task in SCT, but I get the following error - My source is SQLServer and my target is MySQL DB v 5.7.23.

Here is the generated mappings JSON:

{
  "rules": [
    {
      "rule-type": "selection",
      "rule-id": "1",
      "rule-name": "SelectionRule_1",
      "rule-action": "include",
      "object-locator": {
        "database-name": "sourceDB",
        "schema-name": "dbo",
        "table-name": "%"
      }
    },
    {
      "rule-type": "transformation",
      "rule-id": "2",
      "rule-name": "2",
      "rule-action": "rename",
      "rule-target": "schema",
      "object-locator": {
        "database-name": "sourceDB",
        "schema-name": "dbo"
      },
      "value": "sourceDB_dbo"
    }
  ]
}

How can I fix this issue?


Solution

  • fixed it by removing the "database-name" element under the "object-locator" element. Tested first in AWS DMS directly with the edited JSON.

    Revised TableMapping JSON is as follows -

    {
      "rules": [
        {
          "rule-type": "selection",
          "rule-id": "1",
          "rule-name": "1",
          "rule-action": "include",
          "object-locator": {
            "schema-name": "dbo",
            "table-name": "%"
          }
        },
        {
          "rule-type": "transformation",
          "rule-id": "2",
          "rule-name": "2",
          "rule-action": "rename",
          "rule-target": "schema",
          "object-locator": {
             "schema-name": "dbo"
          },
          "value": "sourceDB_dbo"
        }
      ]
    }
    

    I did rename the first rule name to "1" too.