All Projects → ishanjain28 → s3-mongo-backup

ishanjain28 / s3-mongo-backup

Licence: MIT License
Mongodb backups to S3

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to s3-mongo-backup

gitlab-mattermost-backup
A simple backup script for mattermost in gitlab omnibus package
Stars: ✭ 23 (+27.78%)
Mutual labels:  backup, s3, backup-script
minio-rclone-webdav-server
A @rclone served WebDAV server with @minio as the s3 storage backend docker example
Stars: ✭ 17 (-5.56%)
Mutual labels:  backup, s3
WebServerCloudBackups
Automatic backups your web projects bases and files to the clouds via WebDAV.
Stars: ✭ 20 (+11.11%)
Mutual labels:  s3, backup-script
docker-aws-s3-sync
Docker container to sync a folder to Amazon S3
Stars: ✭ 21 (+16.67%)
Mutual labels:  backup, s3
elasticsearch-shell-backup
Elasticsearch 2, 5 shell script backup utils.
Stars: ✭ 18 (+0%)
Mutual labels:  backup, backup-script
Dive-Into-AWS
Links to the Repos and Sections in our Dive into AWS Course.
Stars: ✭ 27 (+50%)
Mutual labels:  aws-s3, s3
virtnbdbackup
Backup utiliy for Libvirt / qemu / kvm supporting incremental and differencial backups.
Stars: ✭ 62 (+244.44%)
Mutual labels:  backup, backup-script
raptor
The definitive EasyEngine installer with fully functional backup-restore and SFTP functionalities included
Stars: ✭ 26 (+44.44%)
Mutual labels:  backup, backup-script
kube-dump
Backup a Kubernetes cluster as a yaml manifest
Stars: ✭ 142 (+688.89%)
Mutual labels:  backup, backup-script
radio
Redundant Array of Distributed Independent Objectstores in short RADIO performs synchronous mirroring, erasure coding across multiple object stores
Stars: ✭ 25 (+38.89%)
Mutual labels:  backup, s3
aws-utils
This repository provides utilities which are used at MiQ.
Stars: ✭ 20 (+11.11%)
Mutual labels:  backup, s3
docker base images
Vlad's Base Images for Docker
Stars: ✭ 61 (+238.89%)
Mutual labels:  backup, s3
fss3
FSS3 is an S3 filesystem abstraction layer for Golang
Stars: ✭ 52 (+188.89%)
Mutual labels:  aws-s3, s3
ionic-image-upload
Ionic Plugin for Uploading Images to Amazon S3
Stars: ✭ 26 (+44.44%)
Mutual labels:  aws-s3, s3
bash-backup
Simple backup script for GNU/Linux servers
Stars: ✭ 76 (+322.22%)
Mutual labels:  backup, backup-script
punic
Punic is a remote cache CLI built for Carthage and Apple .xcframework
Stars: ✭ 25 (+38.89%)
Mutual labels:  aws-s3, s3
aws-s3-backup
This app allows you to use AWS (Amazon Web Services) S3 as backup system for desktop environments. 🚀
Stars: ✭ 67 (+272.22%)
Mutual labels:  aws-s3, backup-script
auto-mysql-backup
a wrapper for automysqlbackup
Stars: ✭ 19 (+5.56%)
Mutual labels:  backup, backup-script
laravel-uppy-s3-multipart-upload
Multipart Uploads using Laravel, AWS S3, and Uppy
Stars: ✭ 30 (+66.67%)
Mutual labels:  aws-s3, s3
laravel-s3-tools
This Laravel package contains additional functionality not currently in Laravel for interfacing with Amazon's S3 service (including managing versioned objects).
Stars: ✭ 31 (+72.22%)
Mutual labels:  aws-s3, s3

s3-mongo-backup

This Module Helps in automating mongodb database Backups and uploading them to AWS S3.

Features

  • Supports Promises
  • Uploads Backups to S3 in "mongoDbBackups" folder
  • Uses GZip Compression to reduce Backup Size

Usage

Import

const MBackup = require('s3-mongo-backup');

Create a configuration Object

var backupConfig = {
    mongodb: "mongodb://username:password@localhost:27017", // MongoDB Connection URI 
    s3: {
        accessKey: "",  //AccessKey
        secretKey: "",  //SecretKey
        region: "",     //S3 Bucket Region
        accessPerm: "private", //S3 Bucket Privacy, Since, You'll be storing Database, Private is HIGHLY Recommended
        bucketName: "" //Bucket Name
    },
    keepLocalBackups: false,  //If true, It'll create a folder in project root with database's name and store backups in it and if it's false, It'll use temporary directory of OS
    noOfLocalBackups: 5, //This will only keep the most recent 5 backups and delete all older backups from local backup directory
    timezoneOffset: 300 //Timezone, It is assumed to be in hours if less than 16 and in minutes otherwise
}

Or

var backupConfig = {
    mongodb: {
        "database": "freecodecamp",
        "host": "localhost",
        "username": "admin",
        "password": "password",
        "port": 27017
    },   
    s3: {
        accessKey: "",  //AccessKey
        secretKey: "",  //SecretKey
        region: "",     //S3 Bucket Region
        accessPerm: "private", //S3 Bucket Privacy, Since, You'll be storing Database, Private is HIGHLY Recommended
        bucketName: "" //Bucket Name
    },
    keepLocalBackups: false,  //If true, It'll create a folder in project root with database's name and store backups in it and if it's false, It'll use temporary directory of OS
    noOfLocalBackups: 5, //This will only keep the most recent 5 backups and delete all older backups from local backup directory
    timezoneOffset: 300 //Timezone, It is assumed to be in hours if less than 16 and in minutes otherwise
}

Call the Function and provide Configuration Object to it.

MBackup(backupConfig)
    .then(
    onResolve => {
    // When everything was successful
        console.log(onResolve);
},
    onReject => {
    // When Anything goes wrong!
        console.log(onReject);
});

See examples directory for more examples

Timezone offset's Purpose

Database zip files are stored in format {database_name}_{YYYY-MM-DDTHH:mm:ss}. Here, If you don't provide a Timezone offset, It'll assume UTC timezone and name all the backups accordingly. Now, If something goes wrong at "2:00 PM" in your timezone and you need to restore a backup made at "1:00 PM" in your timezone, You'll have to change UTC time to your time and then see which backup you have to restore.

But If you provide a timezone of where ever you live, You can immdiately recognise which backup can be useful.

To see how to provide Timezone offset, Please refer to moment#utcOffset

License

MIT

Changelog

2.0.0 -> Uses MongoDB Connection URI directly, instead of asking for individual values of username, database name, password and database host.

NOTE

  1. This module uses mongodump to create backup of database, You need to have it installed on the machine on which you are using this module.
  2. To restore the generated backups
mongorestore --host localhost --port=27017 --gzip --archive=\<path to backup.gz\>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].