Questions tagged [mongodump]

Mongodump is a utility for creating a binary export of the contents of a database.

Consider using this utility as part of an effective backup strategy. Use mongodump in conjunction with mongorestore to restore databases.

362 questions
9
votes
2 answers

Get the size of all the documents in a query

Is there a way to get the size of all the documents that meets a certain query in the MongoDB shell? I'm creating a tool that will use mongodump (see here) with the query option to dump specific data on an external media device. However, I would…
Cydrick Trudel
  • 9,957
  • 8
  • 41
  • 63
9
votes
2 answers

Mongodump with Replica Set : how to force on secondary?

I have a strange problem with my MongoDB Replica Set backup. I have 2 servers (one primary and one secondary) and I run a backup task every 2 hours. I use this: mongodump.exe --db MyBase --out "d:\Backups" But, when I run this backup, my client…
Fred Mériot
  • 4,157
  • 9
  • 33
  • 50
9
votes
3 answers

Mongodb's "mongodump" command, javascript execution error

Perhaps I have a complete misunderstanding of how mongodump is supposed to work, but I can't seem to get it to do anything besides returning a JavaScript execution failed: SyntaxError: Unexpected identifier error. Here's what I'm doing: Mongod is…
JVG
  • 20,198
  • 47
  • 132
  • 210
8
votes
1 answer

How to mongodump from OpenShift and mongorestore locally on MongoDB 2.4.9?

I just did this myself (as a RockMongo export and import was corrupted) so just posting here. Note this was for MongoDB verison 2.4.9 with corresponding versions of mongodump and mongorestore.
user1063287
  • 10,265
  • 25
  • 122
  • 218
7
votes
1 answer

Get JSON file from mongodump

I'm trying to export one of my mongo collections using this command: "C:\Program Files\MongoDB\Server\3.2\bin\mongodump" -h 127.0.0.1 --port 3001 -d meteor I have a BSON file with my db collection but i want it in a JSON file. How can I do it?
alpheonix
  • 269
  • 2
  • 5
  • 12
7
votes
2 answers

How to convert MongoDB archive file to JSON format?

If I dump a database like so: mongodump --archive=out.mdb Is there some way to convert out.mdb to a flat JSON file? If so, how? (for example, if I just wanted to restore a single document)
ffxsam
  • 26,428
  • 32
  • 94
  • 144
6
votes
1 answer

mongodump.exe and mongorestore.exe files are missing

Yesterday I reinstalled Windows 10 on my PC and downloaded and installed the current version of MongoDB Enterprise from the MongoDB website. After installing MongoDB, it works fine. But the mongodump.exe and mongorestore.exe files are missing in the…
John Wink
  • 95
  • 1
  • 2
  • 11
6
votes
5 answers

MongoDB upgrade from 3.6 to 4.0: How to fix the "collection does not have uuid in kvcatalog" exception?

I run a MongoDB replica set in a containerization environment orchestrated by Rancher. After rolling out the latest update, MongoDB as been upgraded from 3.6.x to 4.0.x (latest). No upgrade path has been followed and, as a result, when trying to…
hyperd
  • 161
  • 2
  • 6
6
votes
3 answers

how to restore a collection or collections in mongodb from an archive file?

I have created a dump in an archive file by the following command : mongodump --archive=newcollection.1.archive --db neel --collection newcollection While restoring with the mongorestore i am getting an error :the --db and --collection args should…
Neel
  • 71
  • 1
  • 1
  • 5
6
votes
1 answer

Mongodb database backup on windows

Ive got a problem concerning the mongodump function provided in mongodb. When the below code is run on mongodb shell it doesnt respond, Mongodump --db database1 --out path:
Naveed Sheriffdeen
  • 940
  • 6
  • 18
  • 37
6
votes
1 answer

How to limit CPU and RAM resources for mongodump?

I have a mongod server running. Each day, I am executing the mongodump in order to have a backup. The problem is that the mongodump will take a lot of resources and it will slow down the server (that by the way already runs some other heavy…
Milos Cuculovic
  • 19,631
  • 51
  • 159
  • 265
6
votes
2 answers

Mongodb data files become smaller after migration

On my first server I get: root@prod ~ # du -hs /var/lib/mongodb/ 909G /var/lib/mongodb/ After migration this database with mongodump/mongorestore On my second server I get: root@prod ~ # du -hs /var/lib/mongodb/ 30G /var/lib/mongodb/ After I…
n0nSmoker
  • 832
  • 11
  • 26
6
votes
1 answer

mongodump with replica set with oplog throws error: "oplog mode is only supported on full dumps"

I have a replica set with 3 members. Each one is running mongod 2.4.8 on Linux. I am using MMS agent to monitor the health of my replicaset/hosts and all appears ok. I am using mongodump to backup my dbs & can do a successful dump if I don't use the…
RSX
  • 376
  • 4
  • 14
6
votes
1 answer

mongodump will not honor query on collection

I'm running the following command on a box that is part of a sharded replicate set. I'm just trying to export from this specific shard, I will run the same command on the other shard as well. When I do this, Mongo should be dumping a maximum of 1.72…
5
votes
0 answers

mongodump results in Failed: can't create session: could not connect to server: connection() : dial tcp: i/o timeout

I am trying to backup a database from MongoDB Atlas. When running the following mongodump command (with missing information of course): mongodump --uri mongodb+srv://:@.mongodb.net/ I receive the following…
1 2
3
24 25