I have an error when try to restore a 32GB database in MongoDB. I've tried the following commands but none of them works:
mongorestore --db prod --drop --dir backup-cloud-server/20200221020001/prod --batchSize=1
mongorestore --db prod --drop --dir backup-cloud-server/20200221020001/prod --batchSize=10
mongorestore --db prod --drop --dir backup-cloud-server/20200221020001/prod --batchSize=100
mongorestore --db prod --drop --dir backup-cloud-server/20200221020001/prod --batchSize=1000
[#######################.] DbName.CollectionName 31.4 GB/32.2 GB (98.7%)
[#######################.] DbName.CollectionName 31.7 GB/32.2 GB (99.0%)
[#######################.] DbName.CollectionName 32.9 GB/32.2 GB (99.3%)
[#######################.] DbName.CollectionName 32.1 GB/32.2 GB (99.5%)
[#######################.] DbName.CollectionName 32.2 GB/32.2 GB (99.8%)
restoring indexes for collection DbName.CollectionName from metadata
Failed: restore error: DbName.CollectionName: error creating indexes for DbName.CollectionName: createIndex error: EOF
I've also tried to change the wiredTiger cachedSize to 4GB according to this suggestion https://groups.google.com/forum/#!msg/mongodb-user/Ms2MXCajreg/OsW6ixcSCgAJ but it did not worked.
Any suggestion?
My machine / enviromnent:
OS: MAC OS X 10.14.6
RAM: 32GB
free disk: 80GB
mongod version: v4.2.2
mongorestore version: r4.2.2
EDIT:
Here with the --noIndexRestore flag
2020-03-05T14:43:06.588+0100 [#######################.] dbname.CollectionName 31.7GB/32.2GB (98.5%)
2020-03-05T14:43:09.588+0100 [#######################.] dbname.CollectionName 31.9GB/32.2GB (99.1%)
2020-03-05T14:43:12.588+0100 [#######################.] dbname.CollectionName 32.1GB/32.2GB (99.8%)
2020-03-05T14:43:13.286+0100 [########################] dbname.CollectionName 32.2GB/32.2GB (100.0%)
2020-03-05T14:43:13.286+0100 finished restoring dbname.CollectionName (12660301 documents, 0 failures)
2020-03-05T14:43:13.286+0100 Failed: dbname.CollectionName: error restoring from backup/20200221020001/dbname/CollectionName.bson: reading bson input: unexpected EOF
2020-03-05T14:43:13.286+0100 12667254 document(s) restored successfully. 0 document(s) failed to restore.