Try Studio 3T for Free
  1. Knowledge Base
  2. MongoDB Tutorials
  3. How to Copy MongoDB Databases Across Servers

How to Copy MongoDB Databases Across Servers

Need a fast way to copy MongoDB databases across connections?  Studio 3T has you covered.

Studio 3T’s built-in copy-paste feature allows you to transfer a MongoDB database from one server to another with ease.

Haven’t downloaded Studio 3T yet? Get the latest version here, and let’s get started.

Just need to copy a collection to another database? Here’s how.

Just need to copy a collection to another database? Here’s how

Open Target Connection

In this example we’ve already opened the source connection we would like to copy from: connection_1.  We now need to open the target connection.  To start, open the Connection Manager in the upper right corner of the app and select or import the target connection.  In this case it’s connection_2.

open intended connection

Copy MongoDB Database

Next, right-click the source database you would like to copy from its source connection in the Connection Tree and select Copy All Collections/Views/Buckets. 

In this case, it’s the database pubs within connection_1.

copy database from original connectionYou can also simply press Ctrl-C.

Transfer MongoDB Database

Right-click your target connection in the Connection Tree and select Add Database…

In the pop-up window type the name of the source database you copied from the source connection and press OK.

create empty database in intended connection

It’s important to note that both connections have to be open while copy-pasting databases. This is because databases can’t be copied directly – their content has to be transferred from one to another.

Right-click the empty duplicate database in the target connection and select Paste Collections/Views/Buckets.

You can also press Ctrl-V.

The Operations Window at the bottom left corner of the app will display the progress of the copy job and indicate when it’s finished.

refer to the Operations Window

(Optional) Drop Source MongoDB Database

Finally, if you’d like to remove the source database from the source connection simply right click the database and select Drop Database.  You can also press the Delete key.

drop original database

And that’s all there is to it!

Take advantage of our other handy copy and paste features in Studio 3T:

Updated on March 24, 2020

Was this article helpful?