For some reason I cant connect to atlas using the connection string but instead of using mongo use mongodump. I have tried all type of string.
So its either I get "positional argument not allowed" when the I just replace mongo with mongodump or I get
"failed: error connecting to db: no reachable servers" when I change the host from "mongo://replset1:27017,replset2:27017,replset3:271017/test?replicaSet=replicaSetName" to --host replicaSetName/replset1:27017,replset:27017,replset3:27017
Anyone know what the problem is here.
Rememeber I can make connections using mongo client.
mongodump is a utility for creating a binary export of the contents of a database. mongodump can export data from either mongod or mongos instances; i.e. can export data from standalone, replica set, and sharded cluster deployments. Run mongodump from the system command line, not the mongo shell.
Mongoose can be used to connect to both MongoDB and MongoDB Atlas to your Node. js app.
The mongodump is a utility for creating database backups. The utility can be used for creating binary export of the database contents. Mongodump can export data from both mongod and mongos instances, allowing you to create backups from: A standalone, replica set.
Currently mongoDB Atlas has a copy and paste option for "mongodump" in the "Command Line Tools" section of your cluster. First login to your mongoDB Atlas cluster. Next, on the left side of the screen make sure "Clusters" is chosen. Then, you'll see two options "Overview" and "Security", make sure "Overview" is chosen. Directly below "Overview" you should see "Sandbox". Under "Sandbox" you should see the name of your cluster which is a clickable link, click it. You'll then see a number of optional links to click, click "Command Line Tools". Here you'll see the copy and paste option for "mongodump".
In my case I finally got it this way:
# mongodump -d DB-NAME -u SUPERUSER -p "SUPERUSER-PASSWORD" -o "PATH/TO/DUMP/FOLDER" --authenticationDatabase AUTH-DB --ssl --port 27017 -h "REPLICA-SET-NAME/CLUSTER-SHARD-00-00,CLUSTER-SHARD-00-01,CLUSTER-SHARD-00-02"
Where:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With