Mongodb Data Migration (mongorestore,mongoimport) Error

  mongodb, question

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

  • However, I use mongodump to export the data, transfer it to Ali cloud, and then use mongorestore to restore it to about 1.8%, and there will be an error. Should be caused by insufficient memory.
    Error promptFailed: sof.test: error restoring from /root/sof/test.bson.gz: insertion error: EOF

  • I also tested the mongoexport/mongoimport commands for the same error.

  • I did another test: I installed version 3.2 of mongo v on another computer locally, and exported the data from the local v2.4.9 machine to the ariyun server (mongo v3.2.11). mongorestore encountered the same error.

If I deploy mongo v2.x on Aliyun, I can restore the data successfully.

So could it be between v2 and v3 or v3 itself? However, I feel that the latter is unlikely.
Ask, how to solve?

I just tried it out. I came out from 2.6.6 dump and then restore was successful in 2.6.10 and 3.2.11. It should not be a version problem. The versions are all from backwards compatibility.
Could it be a data problem?
I don’t have that much data here, which is difficult to measure. Try changing a smaller watch.