How to clone / copy MongoDB database from remote server to local?

I am having trouble copying a database to a local computer from a remote server.

I use ssh to work on a remote machine. The database is not password protected. I tried running on my local computer:

> db.copyDatabase('DatabaseName', 'CopyName', 'ns35512048.ip-31-127-173.eu', 'root', 'server password');

and i get

{
"ok" : 0,
"errmsg" : "couldn't connect to server ns35512048.ip-31-127-173.eu:27017 (31-127-173.133), connection attempt failed"

}

You can help:)

EDIT: I finished manually copying the database.

+4
source share
1 answer

You have a firewall blocking this connection. As another user wrote, a tunnel connection is one solution. Or you can upload data from a source and import it to a local computer.

0
source

All Articles