- Newest
- Most votes
- Most comments
Hello,
The data-type limitations between MongoDB and OpenSearch when it comes to migrating string, array, REGEX, CODE, and Binary data which are converted to CLOB through DMS (not supported on OpenSearch).
Source column type = 20 of column <nested.field.path> not supported for given target
The only workaround for this particular limitation, It would be to utilize a transformation rule to change the data-type of every column (%) of every table (%) to a string. Unfortunately, as we know this workaround comes with it's own problems as it will string-ify every piece of data that is being migrated between source and target which is of course not ideal.
As this appears to be combination of the way DMS handles MongoDB source data and which data-types OpenSearch supports, it is not evident at this moment in time if and/or when these limitations will be lifted.
Therefore, I kindly request you to raise a case with AWS Support team. This will enable our team to conduct a thorough investigation and efficiently identify the root cause of the problem.
Link to raise case: https://support.console.aws.amazon.com/support/home#/case/create
Thanks!
The issue you're experiencing with AWS DMS migrating nested documents from MongoDB to Amazon OpenSearch Service is likely due to the handling of nested fields in the migration process. Here are some potential solutions and considerations:
-
JSON Coercion: Instead of using NestingLevel, try using JSON coercion for nested fields. You can prefix the source column names with 'json_' to create nested JSON documents within the target document. This can be done manually or through transformation rules in your DMS task.
-
Transformation Rules: Create transformation rules to handle the nested fields. For example, you could use a rule to rename the nested fields with the 'json_' prefix. This tells DMS to treat these fields as JSON objects rather than trying to flatten them.
-
Check OpenSearch Mapping: Ensure that the mapping in your OpenSearch index can accommodate nested fields. You might need to explicitly define mappings for nested fields if dynamic mapping isn't handling them correctly.
-
DMS Version: Consider upgrading to the latest version of DMS if possible. Newer versions may have improved support for handling complex data types and nested structures.
-
LOB Handling: If any of your nested fields contain large objects, ensure that LOB columns are set to nullable in the target database. This is a requirement for DMS when dealing with LOB data.
-
OpenSearch Client Version: The error message suggests there might be a version mismatch or compatibility issue between the DMS OpenSearch client and your OpenSearch Service version. Double-check that your DMS version is fully compatible with OpenSearch 2.17.
-
Column Mapping: In your DMS task settings, you might need to explicitly map the nested fields to their corresponding OpenSearch data types. This can help DMS understand how to handle these fields during migration.
-
Task Logs: Continue to monitor the detailed task logs. Look for any patterns in the fields that are causing issues and consider creating specific transformation rules for those fields.
If these steps don't resolve the issue, you may need to consider alternative approaches, such as using a custom ETL process or leveraging AWS Glue for more complex data transformations before loading into OpenSearch.
Remember to test any changes in a non-production environment first to ensure they don't cause unintended consequences in your data migration process.
Sources
Using Amazon DocumentDB as a target for AWS Database Migration Service - AWS Database Migration Service
AWS DMS Failing to Migrate Tables with LOBs and JSONB Columns | AWS re:Post