I\'m trying to export and import data from an old MongoDB database server to Azure CosmosDB with MongoDB API using mongodump and mongorestore. But i\'m having issues with the co
You can try a version of mongorestore that shipped with MongoDB 3.4. This may not be able to read recent dumps though.
The ismaster output you provided includes:
logicalSessionTimeoutMinutes: 30
This advertises session support but https://docs.microsoft.com/en-us/azure/cosmos-db/mongodb-feature-support-36 says cosmosdb does not support sessions.
CosmosDB is advertising support for a feature it does not implement, the tooling then (correctly) attempts to use it. This is a bug in cosmosdb.
I found that the various mongotools (mongoimport, mongorestore, etc.) seem to ignore the retrywrites=false
or retryWrites=false
in the URI, but tacking on the option --writeConcern="{w:0}"
allows the command to run successfully on instances that don't support retryable writes