0

I am migrating from server OLD at the old hosting company to server NEW at the new hosting company.

I want to run the clone command so I clone the mongoDB from OLD to NEW.

For OLD: The public ip address is: 44.55.66.77. The machine login user name is: admin, and the password is password

What is the right way to do this?

So far I can't even log into the server OLD

So far I have tried the following command prompts on NEW:

mongo -u admin -p password 44.55.66.77

mongo remote-ip:44.55.77.66 -u admin -p password

That don't work

I also tried this from mongo shell:

db.CopyDatabase('OldDb', 'NewDb', '44.55.66.77', 'admin', 'password')

and I get: the "could not connect to server" error message

Barka
  • 8,764
  • 15
  • 64
  • 91

1 Answers1

0

Aside from firewall considerations in order to copy data between MongoDB servers, db.copyDatabase() (aka the copydb command) has a number of important usage caveats including:

  • copydb does not produce point-in-time snapshots of the source database; writing data to the source or destination database during the copy process will result in divergent data sets
  • copydb does not lock the destination server during its operation, so the copy will occasionally yield to allow other operations to complete.

There is also a known issue that copydb may not work with the role-based privileges in MongoDB 2.4 if you have authentication enabled (see SERVER-8213, which was recently fixed in the 2.5.x development releases).

A much better approach to migrating your data would be to restore from a normal backup using mongodump/mongorestore or file system snapshots. The Backup & Recovery section of the MongoDB manual has tutorials covering procedures for different deployment types.

Stennie
  • 63,885
  • 14
  • 149
  • 175