How to copy MongoDB database from server to local machine? Or just may be dump database on to the folder on the server and then scp it to local machine? I'm trying to use mongodump from /usr/bin, but nothing good comes out of it, for instance:
mongodump --ssl -u root -p password --authenticationDatabase name -d databaseName -o /database
--&gt;Failed: error connecting to db server: no reachable servers
if:
mongodump -u root -p password --authenticationDatabase name -d databaseName -o /database
--&gt;Failed: error connecting to db server: server returned error on SASL authentication step: Authentication failed.
tried to do --host=ip.ad.re.ss:27017
tried to do --host=host-name:27017
--host=127.0.0.1:27017
--host=web-address:27017
tried to switch off mongodb...
Tried to copy files manually, but end up with the empty database on the local machine...
tried to use: mongo --&gt; db.copydatabase(from, to, name)
Nothing is happening positive... How to use mongodump? Possible to use any other way. Only through terminal, ubuntu setup doesn't have any gnu.
Basically what is missing from your mongodump command is... &quot;&quot; round your --host -value.
--host=&quot;host-name:27017&quot;

Check similar question here