How to backup and restore specific collections using atlas cli (atlas command)

The MongoDB Atlas CLI documentation does not explicitly describe the process for restoring a specific collection from a snapshot directly into a cluster.

While there are methods involving mongosh and mongodump that facilitate downloading a snapshot and then uploading specific collections with mongorestore , I am looking for a more direct approach.

Is there a method to restore a particular collection from a snapshot to my cluster using the MongoDB Atlas CLI atlas command, without the need to first download and then upload the collection?

Hi @Rishabh_Ahuja, welcome to the community!

Unfortunately, the only way to restore a specific collection or database from a cluster is using mongodump and then mongorestore

but that would involve first dumping the collection on your computer and then restoring it . The use of localhost / computers scares me as there could be some network problem and the data could be corrupted

@Artur_57972 what do you think ? whats the optimal solution to this problem?

Hi @Rishabh_Ahuja,
As suggested from @Artur_57972, the only way to dump a single collection is using dump & restore.
I don’t understand where Is the problem in using the dump and restore…
How big is the size of collection to dump?


15 gig @Fabio_Ramohitaj :sweat_smile:

Hi @Rishabh_Ahuja,
Come on, it’s not huge.
If you have a decent connection, and an SSD on the server/computer, it will also be fast as an operation.


need the most optimize way man , cant risk it @Fabio_Ramohitaj

Hi @Rishabh_Ahuja,
Ok, if you want to reduce the risk you can split the collection in multiple part with the --query option.

From the documentation: