Having trouble with mongorestore command

I am having trouble importing the data using the mongorestore command. Once I put in my cluster URI, where do I specify the username and password? If I don’t specify the m220student username, then I keep getting an insufficient error message.

This was the command given in the README file, but I can’t seem to get it to work using my actual cluster URI

mongorestore --drop --gzip --uri mongodb+srv://m220student:m220password<YOUR_CLUSTER_URI> data

Hello siddharth-paruchuru,

Thanks for the note. Have you been able to find your Atlas URI string on the Atlas website? It should be available under “Connect with the Mongo shell”.

In this connection string:

mongo "mongodb+srv://m220student:m220password@<YOUR_CLUSTER_URI>"

The username and password are specified after mongodb+srv://.

Can you post the URI string you are using to connect?

Thanks,
Matt

@mattjavaly

I am able to get it to work now. The error I had was that I kept missing the ‘@’ symbol in the connection string, because that was never there in the README page

Thanks!

so what is this string look like?

Hello @dsdenisov,
I think some people may get this issue. If any people have a chance to work with proxy or terminal connection that requires user name and password, they know that there is an “@” character to separate authenticate information with uri, however, if some people just use app interface to do this, they may don’t know the issue.
I think you can change the read-me file like:
mongorestore --drop --gzip --uri mongodb+srv://m220student:m220password@<YOUR_CLUSTER_URI> data

Thanks,
Hieu Tran

@dsdenisov, jerrybk108 had it right, I used that same string and it worked when I used my URI

Hi mattjavaly,
While importing data I am getting this error

D:\MongoDB\M220\mflix-python>mongorestore --drop --gzip --uri mongodb+srv://m220student:m220password@mflix-shard-00-00-u2avj.mongodb.net/test data
2019-02-13T22:27:46.234-0500 error parsing command line options: error parsing uri (mongodb+srv://m220student:m220password@mflix-shard-00-00-u2avj.mongodb.net/test): lookup _mongodb._tcp.mflix-shard-00-00-u2avj.mongodb.net: dnsquery: DNS name does not exist.
2019-02-13T22:27:46.235-0500 try ‘mongorestore --help’ for more information

I just tried your cluster and working well. How about like this:
mongorestore --drop --gzip --uri mongodb+srv://m220student:m220password@mflix-u2avj.mongodb.net data

1 Like

Yeah now its working

2019-06-20T00:01:08.456+0530 WARNING: ignoring unsupported URI parameter ‘retrywrites’
2019-06-20T00:01:10.552+0530 using default ‘dump’ directory
2019-06-20T00:01:10.552+0530 see mongorestore --help for usage information
2019-06-20T00:01:10.552+0530 Failed: mongorestore target ‘dump’ invalid: CreateFile dump: The system cannot find the file specified.
‘w’ is not recognized as an internal or external command,
operable program or batch file.

hey can anyone help me i’m getting this error.

What command you used
Does the file exist?
May be you are in wrong directory
Please check again

1 Like