Mongorestore with DocumentDB Issue

I am trying to use mongorestore to move a database to DocumentDB. From the exact same EC2 instance, I run the same mongorestore command from 4.0 and 4.2. The 4.0 run errors based on the dump being in 4.2. When I use the same exact call with the 4.2 shell command, it throws the following error:

error connecting to host: could not connect to server: server selection error: server selection timeout, current topology: { Type: Single, Servers: … Last error: connection() : x509: certificate signed by unknown authority }, ] }

Is there a diff in the call I am missing?

Here is a sample of the call:
mongorestore --ssl --host -d xxx --sslCAFile rds-combined-ca-bundle.pem --username xxx --password xxx “C:\MONGODUMPS\xxx”

I know I must be missing something very simple.


Hi @David_Koth welcome to the community!

DocumentDB is not a MongoDB product but rather a re-implementation of an old MongoDB version with notable differences with the genuine MongoDB of similar version. Please see their documentation for more on this subject.

Thus using any MongoDB official tools on it is not supported. Even if mongorestore works, I would be suspicious if it doesn’t complain about something, as there are too many differences between it and a genuine MongoDB server.

If you need a cloud-hosted database and you’re not locked into a DocumentDB solution, I would encourage you to have a look at MongoDB Atlas, as this is created and supported by MongoDB. You would be able to use the official tools that you’re familiar with :slight_smile:

Best regards


Thanks! We are moving away from MongoDB Atlas as it is not as cost efficient for us.