No release in over a year
A simple gem for backing up a MongoDB database to AWS when hosted on Heroku using a Sidekiq worker.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.17
>= 10.0

Runtime

>= 6.5.5
>= 1.117.2
 Project Readme

🎉 Works with the Heroku 22 Stack! 🎉

A simple gem for backing up a MongoDB database to AWS when hosted on Heroku using a Sidekiq worker.

Installation

gem 'safety_net_heroku'

Usage

Add this buildpack to your Heroku setup: https://github.com/Daltron/heroku-buildpack-mongo-database-tools

Ensure this environment variable is set within Heroku:

ENV['DB_URI_NO_OPTIONS']

Create a new Safety Net Heroku initializer:

# safety_net_heroku.rb

SafetyNetHeroku.config[:database_name] = 'database_name'
SafetyNetHeroku.config[:aws_region] = 's3_region'
SafetyNetHeroku.config[:aws_bucket] = 's3_bucket'
SafetyNetHeroku.config[:aws_backups_directory] = s3_directory'

Add the worker to your sidekiq schedule as a cron job:

# sidekiq_schedule.yml

backup_database:
  cron: "0 3 * * *"
  class: "SafetyNetHeroku::BackupDatabaseWorker"

Your database will now be backed up to the AWS directory specified periodically based on your cron settings! 🎉

Author

Dalton Hinterscher, daltonhint4@gmail.com

License

Safety Net Heroku is available under the MIT license. See the LICENSE file for more info.