1. Knowledge Base
  2. Studio 3T Tutorials
  3. How to Copy a MongoDB Collection to Another Database

How to Copy a MongoDB Collection to Another Database

Are you looking for an easy way to copy MongoDB collections across databases?

Studio 3T’s convenient built-in copy and paste features allow you to copy a MongoDB collection to another database in just a few clicks.

Ready? Download our MongoDB GUI now, and let’s roll.

Copy MongoDB collection

Select the source collection you want to copy and right-click it in the Connection Tree.

In our case, this is collection test.people on localhost.

Choose Copy Collection.

Paste MongoDB collection

Select your target MongoDB database (or collection) that you want to copy your source collection to.

In our example, that is database “test” on server “ADX”.

Right-click your target and choose Paste Collection.

Configure copy & paste

In the Paste Collection dialog, you can choose how the copy operation should treat (existing) document _ids.

Note that this usually only relevant when you decide to copy a collection into another, existing target collection.

If you paste a collection into a target database that already contains a collection with the same name, the source collection will be inserted with the prefix “Copy_of_”.

To finish, click Paste Collection. This will copy your source collection to your target.

And just like that, your MongoDB collection is copied to another database and/or server.

You can always monitor your copy job on the bottom-left corner and cancel any long-running operations.

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

Updated on April 5, 2019

Was this article helpful?

Related Articles

Leave a Comment