CrowiからGrowi移行時にcreateIndex errorが出たとき


背景

社内運用WikiをCrowiからGrowiへ移行するため、こちらを参考に作業を進めていた。

問題

DBのデータ移行のセクションで、mongorestoreコマンドを実行すると、以下のようなエラー文が出て、データ移行がうまくいかなかった。

Failed: growi.users: error creating indexes for growi.users: createIndex error: Index with name: username_1 already exists with different options

対処法

mongorestoreコマンドのオプションに--noIndexRestoreを付けて実行するとうまくいった。

参考URL