Since it is possible to mongodump
/mongorestore
remotely, it makes sense to have them installed in a machine that is not the DB itself, right?
Is there a way to install a standalone mongodump
executable?
Eg. in order to dockerize my DB backup tool
Mongodump is preferable ,if whole database or collection needs to be backedup. use Mongorestore to restore the backed up data, its very fast , stores in Bson mongoexport is preferable for backing up the subset of the documents in a collection Slow compared to mongodump .
It is recommended to use the corresponding versions of mongodump and mongorestore in backup and restore operations. The mongodump command will overwrite the existing files within the given backup folder. The default location for backups is the dump/ folder.
Mongdump does not lock the db. It means other read and write operations will continue normally. Actually, both mongodump and mongorestore are non-blocking. So if you want to mongodump mongorestore a db then its your responsibility to make sure that it is really a desired snapshot backup/restore.
Ubuntu has the tools separate: mongodb-org-tools
Alpine also has an edge/community package: mongodb-tools
I am using the node:alpine Docker to run mongodump/restore and upload to S3, it works well.
You could also try installing and then copying the binaries, but I imagine they have a lot of dependencies so you might as well find a way to use the tools package, or you'll be creating your own.
mongo-tools
since Ubuntu 18.04: https://launchpad.net/ubuntu/bionic/+package/mongo-tools
sudo apt install mongo-tools
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