Copy database on remote MongoDB Atlas Cluster after 4.2

Hello,
copyDatabase() is deprecated and mongodump + mongorestore are recommanded to copy database.
https://docs.mongodb.com/database-tools/mongodump/#mongodump-example-copy-clone-database

However, does it means that I need to download to local and re-upload the entire database?
Is there anyway to copy only on the Atlas Cluster?

Hi @Tak_Kin_Cheng,

I think copyDatabase worked in a way where it will read all data to your client and write to target host (similar to dump and restore)

The suggsted method is to use mognodump and restore. In 4.4 you can use a $out from one collection to another database with same collection name.

Doing so for all collections in a database will essentially clone the data but you will need to rebuild all indexes .

Best
Pavel

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.