Restore MongoDB Atlas Collection using MongoDB Compass
Tags: mongodb, database, cloud
Published: 2021-10-06 12:40:44

So you already have your backup and decided to restore this on your MongoDB Atlas database? In this tutorial, we will tackle restoring a MongoDB Collection into MongoDB Atlas using MongoDB Compass.

## Prerequisites

* MongoDB Atlas Cluster
* MongoDB Compass Installed 
* A MongoDB database collection backup; if you don't have one, SimpleBackups can help you [backing up your MongoDB Atlas](https://simplebackups.com/mongodb-backup/)

**MongoDB Atlas** is a fully-managed cloud database developed by the same people that build MongoDB.

**MongoDB Compass** is a GUI that allows you to analyze your documents and displays rich structures within your collections.

In this article we will go through connecting to our MongoDB Atlas database using MongoDB Compass and importing a sample collection into your MongoDB Atlas database.

- - -

## Grab your MongoDB Atlas Database Credentials

Head over to <https://cloud.mongodb.com/v2/> then choose your MongoDB cluster and click on "Connect" on the cluster you want to connect to.


[![SimpleBackups - MongoDB Atlas Connect to Cluster](https://downloads.intercomcdn.com/i/o/399577689/01912fa8a9361f3f373a6f58/SimpleBackups-Mongo-NewConnection1.png)](https://downloads.intercomcdn.com/i/o/399577689/01912fa8a9361f3f373a6f58/SimpleBackups-Mongo-NewConnection1.png)

When the list of option pops up, make sure you choose the MongoDB Compass option.

[![SimpleBackups - MongoDB Atlas Connect to Cluster via Compass](https://downloads.intercomcdn.com/i/o/399579719/e016bf02d42f282d9c9b8bde/SimpleBackups-Mongo-NewConnection5.png)](https://downloads.intercomcdn.com/i/o/399579719/e016bf02d42f282d9c9b8bde/SimpleBackups-Mongo-NewConnection5.png)

From this screen, you can copy the connection string at the bottom which includes the connection details (username, password placeholder, database host and so on).

**Note:** this is the connection string you can add to SimpleBackups when backing up your MongoDB Atlas database.

[![SimpleBackups - MongoDB Atlas Grab Connection String](https://downloads.intercomcdn.com/i/o/399580536/abb31ea82d837e8c1e9fb60a/SimpleBackups-Mongo-NewConnection6.png)](https://downloads.intercomcdn.com/i/o/399580536/abb31ea82d837e8c1e9fb60a/SimpleBackups-Mongo-NewConnection6.png)

- - -

## Connect to MongoDB Atlas via MongoDB Compass

Paste the connection string you obtained from the previous step.

**Note:** make sure you replace `<password>` from the connection string by the actual password of your MongoDB Atlas user.

[![SimpleBackups - MongoDB Compass Connect Atlas](https://downloads.intercomcdn.com/i/o/399581169/96937fff4f94951ae6ff1ae6/SimpleBackups-Mongo-NewConnection.png)](https://downloads.intercomcdn.com/i/o/399581169/96937fff4f94951ae6ff1ae6/SimpleBackups-Mongo-NewConnection.png)

- - -

## Import MongoDB Atlas collection via MongoDB Compass

When you connect successfully, you will see all databases under your MongoDB on the left as shown above. Select the database and the collection you want to import the data into. In this case, we had a MongoDB database called `myDatabase` and a collection called `myCollection`.

When you select the target collection form the left hand side, click "ADD DATA" and then "Import File".

[![SimpleBackups-MongoDB-Atlas-Import-Compass-NewConnection1](https://downloads.intercomcdn.com/i/o/399586765/a4883f5271b33704e7fa5abd/SimpleBackups-MongoDB-Atlas-Import-Compass-NewConnection1.png)](https://downloads.intercomcdn.com/i/o/399586765/a4883f5271b33704e7fa5abd/SimpleBackups-MongoDB-Atlas-Import-Compass-NewConnection1.png)

Finally, on the screen below, you can select the JSON document (MongoDB collection) you want to import.

[![SimpleBackups-MongoDB-Atlas-Import-Compass-NewConnection2](https://downloads.intercomcdn.com/i/o/399586810/6cdb1d200047e5b1a86b7171/SimpleBackups-MongoDB-Atlas-Import-Compass-NewConnection2.png)](https://downloads.intercomcdn.com/i/o/399586810/6cdb1d200047e5b1a86b7171/SimpleBackups-MongoDB-Atlas-Import-Compass-NewConnection2.png)

- - -