Hi all.
I am trying to load a mongodb dump that I have on my local machine into atlas cluster.
I have not used atlas before apart from a small project. I have read everything that grows under the sun and i think i must have a silly issue that i cannot see.
I am on MACOS 10.14.6
the dump has been created with mongodump command (BSON files). I have:
uploaded the dump locally and it works well.
created 2 DB on atlas, all good
installed mongocli on my machine
mongocli --version
mongocli version: 1.15.1
mongo --version
MongoDB shell version v4.2.0
configured a user on atlas
created api keys and use mongocli config to set them up locally
now, 1st problem
mongo “mongodb+srv://cluster0.u7g3w.mongodb.net/beta” --username myusername
This generally means credentials were entered incorrectly. I can see the connection string you posted was: mongo “mongodb+srv://cluster0.u7g3w.mongodb.net/beta” --username
Did you remove the username from this post or is this the full command you had applied?
A username will need to be supplied after the --username option.
For example, connecting to the cluster as user atlasUser:
Modify Databaser Users (This will have instructions if you wish to change the password of existing MongoDB User(s) in Atlas)
If you’re choosing to use the same user credentials that you’re trying to perform the mongoshell connection from and credentials are entered incorrectly, then the mongorestore will also fail.
I have added mongo/bin to my PATH though, wondering if what i miss here
Have you tried running mongorestore from a new terminal after adding it to your PATH?
thank you very much for taking the time to read and answer my question:
there was a typo in my command, i indeed passed my username after --username mongo “mongodb+srv://cluster0.u7g3w.mongodb.net/beta” --username
then was prompted for my password
then got the error message above
(i edited my original post to reflect the change)
as for mongorestore and PATH, indeed i did not make it persist
I have added the new PATH to my .bash_profile now and still face the same error.
is it part of a different install?
Thank you very much for your help
there was a typo in my command, i indeed passed my username after --username mongo “mongodb+srv://cluster0.u7g3w.mongodb.net/beta” --username
then was prompted for my password
then got the error message above
I would believe in this case if you’re still getting the bad Auth error, then I would double check the password if you are certain the username is correct. Alternatively, some additional troubleshooting steps you can take is to either add a new user / password combination or modify the current user’s password and try again.
as for mongorestore and PATH, indeed i did not make it persist
I have added the new PATH to my .bash_profile now and still face the same error.
Are you able to post the output from running export $PATH here? In addition to that, please change directories to the bin folder you have added to PATH and run ls -l to ensure mongorestore is in the bin folder. If you are unable to locate mongorestore, you can download MongoDB Database Tools which will contain mongorestore.
Alternatively, you can run mongorestore directly from the bin folder without needing to add it to PATH.