ZZZSharePoint
ZZZSharePoint

Reputation: 1351

Migrating Cosmos Db sql api from one container to another using DMT tool

I am trying to copy my documents from one container of my db to another container in the same db. I followed this document https://learn.microsoft.com/en-us/azure/cosmos-db/cosmosdb-migrationchoices

and tried using DMT tool. After verifying my connection string of source and target and on clicking Import, I get error as

Errors":["The collection cannot be accessed with this SDK version as it was created with newer SDK version."]}".

enter image description here

I simply created the target collection from the UI. I tried by both ways(inserting Partition Key and keeping it blank). What wrong am I doing?

Upvotes: 0

Views: 1171

Answers (3)

Mårten Wikström
Mårten Wikström

Reputation: 11344

You should use a newer version of the tool.

I ran into this problem and downloaded version 1.8.3 from the GitHub repo here:

https://github.com/Azure/azure-documentdb-datamigrationtool/releases/tag/1.8.3

With this version the problem is solved.

Upvotes: 1

ZZZSharePoint
ZZZSharePoint

Reputation: 1351

Figured out the issue. It was due to this setting in my source database enabled:

My partition key is larger than 100 bytes.

I created a POC this time a source database without this setting enabled and it worked by DMT tool.

Upvotes: 1

Gaurav Mantri
Gaurav Mantri

Reputation: 136226

What wrong am I doing?

You're not doing anything wrong. It's just that the Cosmos DB SDK used by this tool is very old (Microsoft.Azure.DocumentDB version 2.4.1) which targets an older version of the Cosmos DB REST API. Since you created your container using a newer version of the Cosmos DB REST API, you're getting this error.

If your container is pretty basic (in the sense that it does not make use of anything special like auto scaling etc.), what you can do is create the container from the Data Migration Tool UI itself. That way you will not run into compatibility issues.

Upvotes: 0

Related Questions