0

I would like to make a Daily Backup of my MongoDB from a replication set running from ubuntu 14.04 server.

End goal would be to get a daily backup and write the backup to a remote or local share - ubuntu.

Can I batch the mongodump command?

Please help me on this

  • There are multiple supported MongoDB Backup Methods documented in the MongoDB manual. You'll want to read up on the caveats of different approaches, but mongodump is generally only suitable for smaller deployments where data isn't significantly greater than memory. A mongodump forces all data to be read through your mongod, which could have a significant effect on your working set / performance. – Stennie May 2 '16 at 22:44
1

You can execute mongodump from the remote server as mentioned below:

mongodump --host <ip-of-mongodb-server> --port <port-number-of-mongod> --out <some-directory>

This is required mongo server to be accessible from the remote server.

This dump file can be then compressed and archived on remote host or s3.

If the mongo server is not accessible from remote host, in that case you can execute mongodump on local mongodb server and copy it to remote or local share.

  • FYI, as of MongoDB 3.2 mongodump now supports --gzip and --archive options so you no longer need separate steps to compress and/or combine dumps into a single archive file. – Stennie May 2 '16 at 22:46

Your Answer

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