Database tools
Import, export & backups
Move documents with JSON or CSV, copy collections, and back up or restore MongoDB data.
Choose the right transfer
| Goal | Use |
|---|---|
| Move document data into a file or another tool. | JSON array, JSON Lines or CSV document export. |
| Append document records from a file. | JSON or CSV document import. |
| Copy a collection to another database or saved connection. | Copy collection / Paste collection. |
| Create or restore a MongoDB backup. | Collection/database backup using mongodump and mongorestore. |
Collection file actions are in Import / export on the right-click menu. Backup actions explicitly include “collection backup” to distinguish them from document transfers.
Export documents
- For an entire collection, choose Import / export → Export documents (JSON/CSV)….
- For matching documents, run a query and choose Export query results… above its results.
- Choose a format and a new output file using Browse… or an absolute path. Its parent directory must already exist.
- For CSV, review the ordered column list and cell format.
- Choose Start export and monitor Background jobs.
Query export reruns the last executed filter, sort and projection from the beginning. It exports all matching documents, regardless of the loaded page, page size or display memory budget. A newly edited, unrun filter and unsaved document changes are not included.
Export publishes a new file and does not overwrite an existing one. Cancelling or failing a document export removes its temporary output. This is a fresh query against MongoDB, not a transactional snapshot of data changing during export.
Understand JSON and CSV
JSON array and JSON Lines
Exports use canonical MongoDB Extended JSON to retain BSON types. JSON array writes one array of document objects; JSON Lines writes one document per line. Import accepts ordinary JSON and Extended JSON in the selected format.
{"_id":{"$oid":"507f1f77bcf86cd799439011"},"name":"Alice","sequence":{"$numberLong":"9007199254740993"}}
This is one JSON Lines record. For JSON array, wrap records in an array. Constructor expressions such as ObjectId(...) belong in Palryn's BSON editors, not a JSON import file.
CSV
Headers are literal top-level field names. Dots in a CSV header do not traverse nested objects. Export uses the selected columns in order; add fields missing from the sampled suggestions.
- Typed — Extended JSON per cell: each populated cell is a JSON value. An empty cell means a missing field,
nullmeans BSON null, and a JSON empty string means an empty string. Choose the same cell format on import to preserve types. - Plain text — spreadsheet cells: import treats every cell as a string, including numbers and dates. Choose this for text-oriented exchange rather than a BSON round-trip.
Import documents
- Choose Import / export → Import documents (JSON/CSV)…, or the import action above query results.
- Choose the input file, its format and, for CSV, the cell format.
- Review the target collection and choose Start import.
Import appends documents. It does not replace the collection, upsert records or skip duplicate keys. Records without an _id receive generated ObjectIds. Already confirmed batches remain if a later record fails or you stop the job. Rerun queries after import to refresh displayed results.
Copy a collection
Choose Copy collection on the source collection. Navigate to the destination database, on the same or another saved connection, and choose Paste collection. Review the source, destination name and available copy options before starting.
- A new destination copies the documents, indexes and collection options.
- Append keeps the destination's indexes/options. Choose whether duplicate IDs should be overwritten, skipped or inserted with new ObjectIds.
- Replace replaces the destination with a full copy after the temporary copy is built and you have confirmed the replacement.
Views and time-series collections cannot use collection copying. The source is read live, so concurrent changes may or may not be included.
The clipboard entry identifies a collection for a database copy job; it is not a JSON copy of the loaded result rows. Follow the operation in Background jobs and inspect its outcome before reusing the destination.
Back up and restore MongoDB data
Install MongoDB Database Tools 100.3 or newer. In Settings → Tools, configure mongodump and mongorestore, or leave them available on PATH.
Use Import / export → Export collection backup… for a collection or Export database… on a database. Choose a dump folder or MongoDB archive and optional gzip compression. A MongoDB archive is not a ZIP or tar file.
To restore, use Import collection backup… or a database's Import backup…. Explorer also offers Import backup for a connection with no databases. Identify the original database/collection in the backup, then choose the destination; a collection restore can use a new name.
A dump-folder input is the root containing the source database's subfolder. If you enable drop-before-restore, confirm the exact target shown by the dialog. It applies to collections represented in the selected backup scope. Stopped or failed restores can leave partial results.
Monitor background jobs
Open Background jobs from the status area for progress, elapsed time, completion and errors. Document transfers show counts; external backup tools use running status and elapsed time. Closing the jobs panel does not stop its work.
Use a job's Stop action to request cancellation. A database request already in flight may finish, and cancelling an import, copy or restore is not a rollback. Jobs do not resume after the application process exits.