Concept to create backup/restore tool in Meteor?

Now I want to create backup/restore tool in my project (local).
Ex: I have Customer Collection

   {_id: 1, name: Theara, gender: M, branchId: 001}
   {_id: 2, name: Vanna, gender: M, branchId: 001}
   {_id: 3, name: Davy, gender: F, branchId: 002}
   {_id: 4, name: Buntong, gender: M, branchId: 002}
   {_id: 5, name: Kimsan, gender: F, branchId: 003}

And the I want to create the form to backup/restore by branch office.

// Backup Form
   <select name='branchId'>
      <option value="all">All Branches</option>
      <option value="001">001</option>
      <option value="002">002</option>
   <button type="submit">Backup</button>

Thanks all for helping.

We looked into something like that when I was helping @sam with his blog package. It never took off (at least, not my pull request) so I created a shell script to do it. That way I could do backups on a cron job or run it from the command line, during a deploy script (via scp), etc.

Here’s the gist of it:


DATE_STR=`date "+%m-%d-%y_%k-%M-%S"`;
echo "Backing up blog collectsion at $DATE_STR";
mongodump -h -d <yourDBName> -o ./$DATE_STR -c <Collection1>
mongodump -h -d <yourDBName> -o ./$DATE_STR -c <Collection2>
# Repeat for each collection you want backed up


tar -cf <tempFileName> meteor | gzip > <some.tar.gz filename>

In our case, this gets run before we deploy to production, for example.

I think there’s a similar mechanism for doing it inside Meteor - you could look at, for example.

Good luck!

Thanks for your reply.
I tried this package too. but it don’t support with Windows and I can’t custom with collections that we want.