2

My database size is approx 1.5 TB and I have approx 2TB free on backup mount point. But after 10 hours my backup fail due to lack of storage and its just 60% complete. Is their any why through which i can resume my backup from the failure point??

mongodump -u admin -p admin -d tex --host xx.xx.xx.xx --authenticationDatabase admin

Do you have any other option then please also share with me.

1
  • 1
    Parameter --gzip could help.. So you don't run out of space.
    – JJussi
    Commented Jul 2, 2018 at 14:40

1 Answer 1

1

If you're using the WiredTiger storage engine, data in the database is compressed (using snappy by default). In contrast, mongodump output is not compressed. This is why 2TB may not be enough to backup a 1.5TB database.

To determine the uncompressed size of your database, you can run db.stats().dataSize in the mongo shell (see manual).

To determine the uncompressed collection size, use db.collection.stats().size.

Having said that, there is no built-in way to "resume" a dump. However, you can pass a query into mongodump using --query parameter. If you have some kind of timestamp/ordering field in your collection, you may be able to use this parameter. This could also help you to split up your backup so you don't have to do all 1.5TB at once.

Alternatively, you also can pass --gzip into mongodump as suggested by JJussi to ensure the output is compressed.

2
  • I am really thankful for your response. Now, I am using --gzip option and now backup is running fine. But i notice its very very slow and just 20% complete in 24 hours. Is there any special reason.
    – Irfi
    Commented Jul 5, 2018 at 12:56
  • It's just the size of the database and your server's capabilities. mongodump will uncompress the documents from WiredTiger and compress it again using gzip, for all documents in all databases. You might want to take a look at docs.mongodb.com/manual/core/backups to see if any other alternative method could suit you.
    – kevinadi
    Commented Jul 5, 2018 at 22:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.