search

Home  >  Q&A  >  body text

mongodb3.x - mongodb data migration (mongorestore, mongoimport) error

I now want to migrate local Mongo data (50GB) to Alibaba Cloud (memory 1G). The local version is v2.4.9 and the server is v3.2.11

If I deploy the mongo v2.x version on Alibaba Cloud, the data can be restored successfully.

So it may be a problem between v2 and v3, or it may be a problem with v3 itself? But the latter seems unlikely.
How to solve it?

巴扎黑巴扎黑2773 days ago869

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-05-02 09:25:08

    I just tried it. I dumped it from 2.6.6, and then restored it successfully in 2.6.10 and 3.2.11. It shouldn't be a version issue, the versions are all backward compatible.
    Maybe it’s a data problem?
    I don’t have that big data, so it’s hard to test. Try changing to a smaller watch.

    reply
    0
  • 巴扎黑

    巴扎黑2017-05-02 09:25:08

    Read the documentation carefully, cross-version upgrades are clearly prohibited. The correct approach is to upgrade version by version. Two options:

    Upgrade to 3.2 locally version by version and then export to remote

    Your situation should be: 2.4.9 -> 2.6.x -> 3.0.x -> 3.2.11
    Finally, take the data exported in 3.2.11 to mongorestore.

    Install 2.4.9 remotely and upgrade to 3.2.11

    The process also follows the above process.
    Upgrade of each version must be carried out according to the Upgrade Notes of the corresponding version to ensure the correct result in the end.

    reply
    0
  • Cancelreply