Questions tagged [mongodump]

34 questions
85
votes
4 answers

Mongodump: Unrecognized field 'snapshot'

I am using mongodump from mongo tools to download a backup of my server. However as I run the command, the command returns "Unrecognized field 'snapshot'". The full error is: Failed: error reading collection: Failed to parse: { find: "data", skip:…
Dave
  • 1,023
  • 2
  • 9
  • 8
15
votes
3 answers

What is difference between mongodump and mongoexport?

I know that when we have to take full backup at database & collection level we use mongodump but with mongodump we can take backup of a particular record also so what is difference between mongodump and mongoexport?
yogesh.j
  • 173
  • 1
  • 1
  • 5
5
votes
2 answers

MongoDB import bson files from a folder

I am unable to import (.bson) file on my computer to MongoDB database .I have been trying below commands : 1)mongorestore -d demo -c dcoll C:\data\dump\twitter\tweets.bson and 2)mongorestore -d demo -c dcoll /dump/twitter/tweets.bson
sai
  • 51
  • 1
  • 1
  • 2
4
votes
2 answers

MongoDB restore with replica set

I have MongoDB setup like this: Primary | Server1 -----------+--------- Secondary | Server2 -----------+--------- Arbiter | Server3 -----------+--------- Backup | Server4 I have a backup server for daily backup using…
SGRao
  • 41
  • 1
  • 3
2
votes
1 answer

mongodump fails after exactly 10 minutes

Using single instance MongoDB v4.2.0 on Debian 9.11 with collection of 78GB and 60M documents on a 2 vCPUs, 13 GB memory server. This command is invoked on the same server where database runs: mongodump --username user --password pwd…
ssasa
  • 261
  • 4
  • 11
2
votes
1 answer

Mongodb _id Value and Indexes Are Lost During Mongorestore

Steps I used: mongodump copy dump folder to another computer (for each collection I get .bson and metadata files) mongorestore myDumpFolder I noticed the indexes are lost and _id has new values after mongorestore. Can anyone share their…
Will
  • 121
  • 1
  • 2
2
votes
1 answer

mongodump 3.4.1 error reading collection: Closed explicitly

[BACKUP COMMAND]: mongodump -u username -p password -d database --port port -o output path. [ISSUE]: error writing data for collection to disk: error reading collection: Closed explicitly. The storage requirements of my MongoDB database are…
henry vans
  • 21
  • 1
  • 3
2
votes
1 answer

Reliability of mongodump

I understand that the recommended way to backup MongoDB data is to use file system level tools. However, mongodump utility is promoted as a valid alternative for smaller instances, when file system snapshots are not available for some reason. Many…
Konstantin
  • 121
  • 4
2
votes
2 answers

Unable to configure MongoDB replication without initial sync

I have a big MongoDB database on my production server, which I want to set up as a replica set. I understand that if I enable the replica set option on both servers, it will automatically start to sync the data from scratch. But I don't want to sync…
TheDataGuy
  • 1,986
  • 5
  • 36
  • 67
1
vote
0 answers

Using mongodump to dump all databases but exclude a collection

The mongodump tool seems not to support the option --excludeCollection=someCollection when not specifying the --db someDb option. We would like to dump just all databases without explicitly specifying them but exclude certain collections. Failed:…
Andi
  • 111
  • 1
  • 2
1
vote
1 answer

MongoDB: Queries running twice slow on NEW server compared to OLD server

I transferred current/old running DB into a new standalone server for MongoDB. To do this, I performed the following: Took dump of data from OLD server Restored data from the generated dump into NEW server Configured the server for…
Temp O'rary
  • 111
  • 2
1
vote
2 answers

mongodump command with timestamp query

When I execute the below query in mongodb shell, it gives me the number of records updated after the mentioned timestamp. db.getCollection('oplog.rs').find({"ts":{"$gt":Timestamp(1582823397,2)}}) I wish to execute a similar query with mongodump…
Rahul Paryani
  • 11
  • 1
  • 5
1
vote
1 answer

Mongo: mongodump and the config database error

I've setup a backup script on my Ubuntu box using mongodump. However this currently doesn't work because of an error when attempting to dump the built in config database: (Apologies for the image, I couldn't copy paste from the terminal I used) How…
Ian Newson
  • 217
  • 2
  • 8
1
vote
0 answers

Mongodb - Small and Larger deployment

I read the following information from "https://docs.mongodb.com/manual/core/backups/" "mongodump and mongorestore are simple and efficient tools for backing up and restoring small MongoDB deployments, but are not ideal for capturing backups of…
Hanees
  • 11
  • 1
1
vote
3 answers

Failed to import a mongodb database with duplicate fields

I'm trying to import a mongodb database and I've been using the mongorestore command, the import starts without problems until it gives the error: Failed: dbprod.mys_account: error creating collection dbprod.mys_account: error running create…
1
2 3