meteor-up
meteor-up copied to clipboard
Backup and restore mongodb
This is a feature request. It would be nice to run
mup dumpdb path/to/dest/
which would run mongodump
on the server, and transfer the generated file into the dest
directory.
mup restoredb path/to/dump
which would take the given dump and restore it into the database.
+1
+1
+1
please
+1
Yes please!
+1
+1 !!
Here is a meteor database backup example using rclone.
+1
+1
+1
Backup and restore can be achieved via these steps , still having inbuild option in mup will do no harm. https://github.com/xpressabhi/mup-data-backup/
Thank you for those suggesting solutions, however the point isn't that it is currently impossible to restore and backup the database, but that from the two comments, it is clear that the necessary instructions are awkward compared to the way and simplicity with which mup works.
Isn't the point of programming to make our life easier?
It can be a plugin using @xpressabhi script
Hi everybody,
I am trying to write a plugin to enable daily mongo backup on AWS. You can take a look at the code: https://github.com/lbke/vulcan-mongo-backup Though its not very general (tied to AWS and Vulcan.js) it could be a starting point if your database is colocated with your app.
My current solution consists in running mongodump in a cron job initiated by my app, which means installing mongodump within the Docker container and not directly on the server.
But... I can't get it to work. Here is my config, for an Ubuntu server, based on those instructions:
docker: {
image: "abernix/meteord:node-8.4.0-base",
// install mongodump to allow programmatic backups
buildInstructions:[
'RUN'
+ ' apt-get install -y apt-transport-https libwebsockets-dev libssl-dev openssl libcurl3' // allow to download the key / need for mongo install to work
+ ' && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4'
+ ' && echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-4.0.list'
+ ' && apt-get update'
+ ' && apt-get install -y mongodb-org mongodb-org-tools'
]
},
It fails at finding libssl
, which seems necessary for the install to work. But the idea is there.
Hope it can help soemhow and someone manages to add a db backup feature to Meteor Up.
@eric-burel why not try installing libssl on the server?
Hi, you have to install mongodump within the Docker container if you want to setup the cron directly in your app. This way you can use Node and Meteor to manage your crons. Of course you can always setup the cron job directly on your server, but then you have a more complicated setup (write it in shell script or create another container for the job etc.).
Hi all, my approach to the problem is to have a cron job running on my personal computer, that tries to pull the db every hour, but won't do it if a dump for today already exists. I've written a small blog post about it to explain the process. The code is specific to ubuntu and digital ocean but the approach is not. I agree that an automated function would be great.
https://renanlecaro.github.io/automating-backups-of-digital-ocean-meteor-up-install-to-your-ubuntu-workstation.html
@zodern I saw you adding this to the 1.6 milestone. Do you intend to work on this? Would this imply to support management of cronjobs from MUP config?