0

I tried to use mongodump(Version 3.2.5) to backup MongoDB(version 2.4.9). It sucessed. But I can't restore this backup. Why?

./mongorestore -h 127.0.0.1 -u xxx -p xxx --dir /home/jonkyon/mongo_2 --authenticationDatabase admin --drop

2016-04-25T19:08:24.028+0800  building a list of dbs and collections to restore from /home/jonkyon/mongo_2 dir

2016-04-25T19:08:24.029+0800  assuming users in the dump directory are from <= 2.4 (auth version 1)

2016-04-25T19:08:24.030+0800  cannot drop system collection products.system.users, skipping

2016-04-25T19:08:24.031+0800  reading metadata for products.system.users from /home/jonkyon/mongo_2/products/system.users.metadata.json

2016-04-25T19:08:24.031+0800  restoring products.system.users from /home/jonkyon/mongo_2/products/system.users.bson

2016-04-25T19:08:24.032+0800  error: E11000 duplicate key error index: products.system.users.$_id_  dup key: { : ObjectId('570e2f0ca19b9c2cb7e75905') }

2016-04-25T19:08:24.066+0800  restoring indexes for collection products.system.users from metadata

2016-04-25T19:08:24.068+0800  reading metadata for runoob.runoob from /home/jonkyon/mongo_2/runoob/runoob.metadata.json

2016-04-25T19:08:24.070+0800  finished restoring products.system.users (2 documents)

2016-04-25T19:08:24.070+0800  restoring runoob.runoob from /home/jonkyon/mongo_2/runoob/runoob.bson

2016-04-25T19:08:24.070+0800  restoring indexes for collection runoob.runoob from metadata

2016-04-25T19:08:24.071+0800  finished restoring runoob.runoob (2 documents)

2016-04-25T19:08:24.071+0800  restoring users from /home/jonkyon/mongo_2/admin/system.users.bson

2016-04-25T19:08:24.088+0800  Failed: restore error: error running merge command: no such cmd: _mergeAuthzCollections
Tom Sabel
  • 3,935
  • 33
  • 45

1 Answers1

0

The docs states the following "The data format used by mongodump from version 2.2 or later is incompatible with earlier versions of mongod. Do not use recent versions of mongodump to back up older data stores."

Even you are using mongodb 2.4.9, I think you should avoid using a recent version of mongodump with older data stores

Rodrigo Villalba Zayas
  • 5,326
  • 2
  • 23
  • 36