14 Mayıs 2019 Salı

Failed: necodb.contents: error creating collection necodb.contents: error running create command: BSON field 'OperationSessionInfo.create' is a duplicate field



Hi,

I have a migration project.We will migrate from mongo 2.4.12 to mongo 4.0.6.

We are using community version. So  we have to choose mongodump method.

There is no error while exporting data.But import is failed.


Problem:
-----------

##############################################################################
Failed: necodb.contents: error creating collection necodb.contents: error running create command: BSON field 'OperationSessionInfo.create' is a duplicate field


##############################################################################

Solution:
-----------

1)use 2.4.12 mongobackup on the 2.4 database

mongodump --db necodb--out /mondirec/backup/

2)delete or move all .json files from the outputted dump directory

3)use 4.0.6 mongorestore on the remaining .bson files

mongorestore --db necodb --drop /mondirec/backup/necodb




Thanks for dba.exchange.com for this solution.


Reference:

https://dba.stackexchange.com/questions/201827/failed-to-import-a-mongodb-database-with-duplicate-fields

Hiç yorum yok:

Yorum Gönder