I've dumped a mongodb database with the following mongodump command line
mongodump -h www.myhost.com -u myusername -p mypassword -d mydb > dump.bson
And I'm trying to restore the dump on my local server:
mongorestore -h localhost -d mydb dump.bson
Unfortunately it fails with the following error:
assertion: 10264 invalid object size: 1096040772
Does anyone know what could cause this error?
On both servers mongo's version is 1.8.3
Thanks
Because first string output from mongodump
is "db level locking enabled: 0"
You need to do this
tail -n+2 dump.bson > dump_fix.bson mongorestore -h localhost -d mydb dump_fix.bson
excuse my english :P this happened to me when i did export with mongoexport and try to import with mongorestore :D my mistake! i had to use mongoimport. Remember: mongoexport/mongoimport, and mongodump/mongorestore
i hope this is usefull to some one :P
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With