5

I am using mongodump(version 2.4.14) to create a db backup that I restore on another system using mongorestore(version 2.4.14) but all the records are not being dumped and restored in the target mongo(2.4.14) instance.

I have tried:

  1. Restoring the db to two separate instances of mongo and the problem persists on both.
  2. Mongoexport with queries - Mongoexport document export count and db.collection.count does not match.

While trying to debug this, I came across this link in which others came across the same problem but no solution for the problem is mentioned.

I am looking for a any help in regards to finding out what the problem might be, how can I debug this further.

Update - Mongoexport/import a particular query response and importing it to a freshly created database works fine. The issue arises only when importing to existing db.

Sushant
  • 324
  • 2
  • 14
  • May be helpful https://stackoverflow.com/questions/53078520/mongodb-how-to-import-dump-data-from-gz-file/53079408#53079408 – Hardik Shah Aug 22 '19 at 11:38
  • MongoDB 2.4.14 was released in 2015. Please try upgrading to the latest version (4.2.0) and retry the dump/restore process to ensure that you're not hitting an old bug. – kevinadi Aug 23 '19 at 05:50
  • @HardikShah I used the same approach. – Sushant Sep 03 '19 at 05:09
  • @kevinadi I can't upgrade it currently. I found a temporary fix for my problem. I am using mongoexport with queries to take backups that can be restored using mongoimport. – Sushant Sep 03 '19 at 05:09
  • Got the same problem (i started the bounty). Using mongo 4.04. Documents count does not match. – Joe Dec 06 '22 at 21:08

0 Answers0