Step 1: Export the MongoDB Atlas Database
Export your MongoDB Atlas database to a BSON (Binary JSON) dump usingmongodump.
-
Export the database
Use
mongodumpwith the same connection string as in your backend.env. ReplaceMONGO_URLwith theMONGO_URLvalue fromMeridian/backend/.env, and set a local path for the dump:
Your dump path is only a temporary location. Examples:
C:\Users\<username>\dump (Windows) or ~/dump (macOS/Linux).your-atlas-connection-string with your actual Atlas connection string and /path/to/dump with the directory where you want the dump files.
Step 2: Import the Dump into Your Local MongoDB Instance
Import the BSON dump into your local MongoDB usingmongorestore.
-
Import the database
Run
mongorestorewith the dump path and the database name (e.g.studycompass):
Append the database name to your dump path. For example, if your dump path was
C:\Users\James\dump, the mongorestore path is C:\Users\James\dump\studycompass.your-local-db-name with the name you want for your local database, /path/to/dump with the path to the dump directory, and your-atlas-db-name with the Atlas database name (e.g. studycompass).