https://github.com/bradoyler/mongo-backup-to-s3
stream mongodb backups to S3, with ease
https://github.com/bradoyler/mongo-backup-to-s3
Last synced: about 1 month ago
JSON representation
stream mongodb backups to S3, with ease
- Host: GitHub
- URL: https://github.com/bradoyler/mongo-backup-to-s3
- Owner: bradoyler
- Created: 2015-12-31T06:00:10.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-09-07T01:36:10.000Z (over 8 years ago)
- Last Synced: 2025-03-16T23:21:50.167Z (about 1 month ago)
- Language: JavaScript
- Homepage: http://bit.ly/stream-mongo
- Size: 5.86 KB
- Stars: 10
- Watchers: 3
- Forks: 7
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DEPRECATED due to restore issues with driver version 2.5+
### Notice: incompatible with Mongodb 3.x
Mongodb 3.2 now has similar utility for streaming backups.# Mongo Backup to S3
Easily stream mongodb backups to S3[![NPM Version][npm-image]][npm-url]
## Motivation
Explore an inexpensive way to backup your MongoDb databases## Get Started
Setup an S3 bucket, run this in a cron job using a Heroku Single Dyno (worker)### Install
```sh
npm install mongo-backup-to-s3
```Example:
```
var mongoBackup = require('mongo-backup-to-s3');var config = {
mongodb:{
url: process.env.MONGO_URL
},
s3:{
bucket:'mybucket',
folder:'backups',
key: process.env.AWS_ACCESS_KEY,
secret: process.env.AWS_SECRET_KEY
}
};mongoBackup.dumpToS3(config);
```Generated filename in S3: `backups/mongo_2015-12-30_22-16-34_mydatabase.dmp`
## Dependent modules
This module relies heavily on [mongo-dump-stream](https://github.com/punkave/mongo-dump-stream) so it can output the 'dump' to a stream, and so we don't have to use `mongodump` (which requires a child process).[npm-image]: https://img.shields.io/npm/v/mongo-backup-to-s3.svg
[npm-url]: https://npmjs.org/package/mongo-backup-to-s3