1

I have my remote mongodb database backed up and downloaded it to my local machine at /var/www/mongobackups3/

So I do this to insert/ restore it to the mongodb in my local machine:

$ mongorestore /var/www/mongobackups3/ --batchSize=10

But I got this error:

Failed: iotdb.datasets: error restoring from /var/www/mongobackups3/iotdb/datasets.bson: an inserted document is too large

I tried the solution from this question by adding --batchSize=10 but still no luck.

Any ideas what else I can do?

The full output:

2019-08-31T01:27:16.781+0200    preparing collections to restore from
2019-08-31T01:27:16.782+0200    reading metadata for iotdb.datasets from /var/www/mongobackups3/iotdb/datasets.metadata.json
2019-08-31T01:27:16.782+0200    reading metadata for iotdb.weathers from /var/www/mongobackups3/iotdb/weathers.metadata.json
2019-08-31T01:27:16.790+0200    restoring iotdb.datasets from /var/www/mongobackups3/iotdb/datasets.bson
2019-08-31T01:27:16.793+0200    reading metadata for iotdb.streams from /var/www/mongobackups3/iotdb/streams.metadata.json
2019-08-31T01:27:16.793+0200    reading metadata for iotdb.sessions from /var/www/mongobackups3/iotdb/sessions.metadata.json
2019-08-31T01:27:16.801+0200    restoring iotdb.weathers from /var/www/mongobackups3/iotdb/weathers.bson
2019-08-31T01:27:16.808+0200    restoring iotdb.sessions from /var/www/mongobackups3/iotdb/sessions.bson
2019-08-31T01:27:16.821+0200    restoring iotdb.streams from /var/www/mongobackups3/iotdb/streams.bson
2019-08-31T01:27:16.826+0200    restoring indexes for collection iotdb.streams from metadata
2019-08-31T01:27:16.831+0200    finished restoring iotdb.streams (93 documents, 0 failures)
2019-08-31T01:27:16.831+0200    reading metadata for iotdb.users from /var/www/mongobackups3/iotdb/users.metadata.json
2019-08-31T01:27:16.841+0200    restoring iotdb.users from /var/www/mongobackups3/iotdb/users.bson
2019-08-31T01:27:16.842+0200    restoring indexes for collection iotdb.users from metadata
2019-08-31T01:27:16.871+0200    finished restoring iotdb.users (2 documents, 0 failures)
2019-08-31T01:27:16.942+0200    restoring indexes for collection iotdb.sessions from metadata
2019-08-31T01:27:16.954+0200    finished restoring iotdb.sessions (2484 documents, 0 failures)
2019-08-31T01:27:17.141+0200    restoring indexes for collection iotdb.weathers from metadata
2019-08-31T01:27:17.196+0200    finished restoring iotdb.weathers (896 documents, 0 failures)
2019-08-31T01:27:17.836+0200    finished restoring iotdb.datasets (12 documents, 0 failures)
2019-08-31T01:27:17.837+0200    Failed: iotdb.datasets: error restoring from /var/www/mongobackups3/iotdb/datasets.bson: an inserted document is too large
2019-08-31T01:27:17.837+0200    3487 document(s) restored successfully. 0 document(s) failed to restore.

Notes:

  1. I am on mongo v4.2.0. Ubuntu 19.04.

  2. datasets.bson has 1.1 GB in size.

  3. each document in datasets collection is 15MB max only.

  4. I have 16 RAM in my local machine. Swap space is 2 GB.

What else I could have done wrong?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.