This version will reach end of life on Feb 2018. To upgrade, go to the Learn more about upgrading your version of MongoDB.


On this page



Copies a remote database to the current database. The command assumes that the remote database has the same name as the current database.

Parameter Type Description
hostname string The hostname of the database to copy.

This method provides a wrapper around the MongoDB database commandclone.” The copydb database command provides related functionality.


To clone a database named importdb on a host named hostname, issue the following:

use importdb

New databases are implicitly created, so the current host does not need to have a database named importdb for this command to succeed.