Mongodump of m001-mongodb-basics

Hello,

Is it possible to make complete copy(including indexes definitions) of for example --db=video --collection=movies from training system to my local instance using mongodump?

I tried following command …

mongodump --host=cluster0-shard-00-00-jxeqq.mongodb.net --port=27017 --username=m001-student --password=m001-mongodb-basics --authenticationDatabase=admin --db=video --collection=movies --archive="test.mongodump"

,which always fails with …

Failed: can't create session: could not connect to server: server selection error: server selection timeout, current topology: { Type: Single, Servers: [{ Addr: cluster0-shard-00-00-jxeqq.mongodb.net:27017, Type: Unknown, State: Connected, Average RTT: 0, Last error: connection() : connection(cluster0-shard-00-00-jxeqq.mongodb.net:27017[-61]) incomplete read of message header: EOF }, ] }

I already used export/import but it would be better to know that collections are completely equal with all additional definitions.

Thanks in advance for your hints.

Try with --ssl option
It worked for me

2020-06-18T07:56:33.743+0530 writing video.movies to archive ‘test.mongodump’
2020-06-18T07:56:35.799+0530 […] video.movies 101/963534 (0.0%)
2020-06-18T07:56:38.801+0530 […] video.movies 101/963534 (0.0%)

2020-06-18T07:59:46.083+0530 [########################] video.movies 963534/963534 (100.0%)
2020-06-18T07:59:46.090+0530 done dumping video.movies (963534 documents)

06/18/2020 07:59 AM 300,837,591 test.mongodump

Also you can get the dumps from this thread

Import MongoDB DataSet for M001 [For Offline Access]

2 Likes

Hi @Pavel_Vrbka,

I hope you found @Ramachandra_37567’s response helpful. Please let us know if you have any other doubts.

~ Shubham

1 Like

mongodump --host=“cluster0-shard-00-00-jxeqq.mongodb.net:27017” --ssl --db=video -u=m001-student -p=m001-mongodb-basics --authenticationDatabase=admin