Data source guides

How to export your MongoDB data

Last checked 28 September 2026

Answer

A user holding the built in backup role, which MongoDB states carries enough privilege to use mongodump against an entire mongod instance, runs mongodump. Output is one .bson file per collection plus a .metadata.json file carrying the collection options and index definitions, in one directory per database. --gzip compresses the files. On a sharded cluster stop the balancer first with sh.stopBalancer() and pause cross shard transactions, DDL operations and chunk balancing; --oplog is not supported there. mongodump cannot read collections using Queryable Encryption or client side field level encryption.

What it holds

Collections of BSON documents, their indexes and collection metadata.

Find the size

Run db.stats(), the dbStats command, per database. dataSize is the uncompressed size of the documents, storageSize is the disk space allocated to collections including free space, indexSize covers the indexes, totalSize is storageSize plus indexSize, and objects is the document count across all collections.

What to enter on the form

MongoDB in GB, and the year your company started using it. Seller form

Sources