Don’t try to export the schema or data via parse-dashboard. It will have the wrong format. Instead, follow the steps below.
To export and import only the schema without data:
- Download MongoDB compass GUI
- Launch Compass and connect to the existing DB using the uri string
- In the databases section select your database and click on _SCHEMA
- Click “Export collection” => “Export full collection” => JSON => save
- In the top left corner click “Connect” => “New connection”
- Connect to your new database using the uri string
- If in the databases section your database has no collections, then launch parse-dashboard with your new database’s uri string. This will create the default collections in your new database.
- In Compass click on the _SCHEMA of your new database and delete the contents.
- Click “Add data” and select the file you’ve previously exported from the existing database
- Refresh the window with parse-dashboard and you should see all the tables created from schema
To export and import data after the schema has been imported:
- Download MongoDB database tools Download MongoDB Command Line Database Tools | MongoDB
- Open command line interface and run this command
mongoexport --uri="mongodb+srv://<yourExistingDBadminName>:<yourExistingDbPassword>@yourexistingdbname.0pxcgwd.mongodb.net" --collection=YourCollectionName --out=collectionName.json
- You need to run this command for every collection (table) that you want to export. Each collection saved to a separate json file.
- Open MongoDB compass and connect to your new database using uri string
- Select your new database and on the right of it click on the plus sign to add a collection
- Give your new collection a name
- Click “Add data” and import the content exported from the old database.
- Refresh the parse-dashboard window and you should see the content populated.