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
But I use mongodump to export the data, transfer it to Alibaba Cloud and use mongorestore to restore it. When the data is restored to about 1.8%, an error occurs. It may be caused by insufficient memory.
Error messageFailed: sof.test: error restoring from /root/sof/test.bson.gz: insertion error: EOF
I tested the mongoexport/mongoimport commands at the same time and got the same error.
I tested again: I installed mongo v3.2 locally on another computer, exported the data on the local v2.4.9 machine, and transferred it to the Alibaba Cloud server (mongo v3. 2.11), the same error occurred in mongorestore.
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?
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.
巴扎黑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:
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.
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.