How do I copy a database from one MongoDB server to another?

If you are using –auth, you’ll need to include your username/password in there…

Also you must be on the “destination” server when you run the command.

db.copyDatabase(<from_db>, <to_db>, <from_hostname>, <username>, <password>);

If all that doesn’t work, you might want to try something like creating a slave of the database you want to copy …

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)