MongoDB dump from 3.2, restore with 3.4, error index safe = null

后端 未结 4 959
忘了有多久
忘了有多久 2020-12-25 12:11

I get the following error (dump MongoDB 3.2) (restore MongoDB 3.4):

Failed: ngivr-dev.ledgerhelpers: error creating indexes for ngivr-dev.ledgerhelpers: **cr         


        
4条回答
  •  难免孤独
    2020-12-25 12:23

    safe=true is not an index specification.

    In previous versions of MongoDB, lower than 3.4, extra indexes specifications can be added. Those were used by specific drivers.

    In 3.4, mongodb added a validation on indexes specification:

    Ensuring that the specified index options are valid. Previous versions ignored invalid options.

    That's why you have this error. I am afraid you need to ensure that the index in your 3.2 version does not have invalid index specificaitons, and after that do the mongodump.

    As kz_sergey says in his answer, you can mongorestore using --noIndexRestore, that should work fine.

提交回复
热议问题