gem

Installation

Requirements

  • Ruby 3.1 or newer.
  • pg_dump on the machine that runs the backup. It should be at least as new as the PostgreSQL server it reads. bb doctor checks this for you.
  • The aws-sdk-s3 gem, if you back up to S3 or R2. Storage SDKs stay opt-in so a project that does not need them does not carry them.

Add the gem

bundle add boring-backup
bundle add aws-sdk-s3

Outside bundler, gem install boring-backup works the same way.

Run the installer

$ bundle exec bb install

Boring Backup

 Rails app   config/environment.rb
 Scheduler   Solid Queue (config/recurring.yml)
 Database    db_production
 Store       none configured

? Where should backups go? S3 (or S3-compatible: R2, MinIO, Spaces)
? Bucket name: db-backups
? Region: eu-central-1
      create  config/initializers/boring_backup.rb
? Schedule: every day at 3am
? Add the backup job to config/recurring.yml under `production:`? Yes
      insert  config/recurring.yml

Next: bundle exec bb doctor   # check the setup before it runs at 3am

The installer inspects files rather than booting the app, so it works on a half-configured project. It looks for config/environment.rb to identify a Rails app, and for config/recurring.yml plus solid_queue in Gemfile.lock to identify the scheduler. When it finds no scheduler it edits nothing and prints a cron line instead.

What it writes

The initializer

# config/initializers/boring_backup.rb
BoringBackup.configure do |config|
  config.register(:s3) do |store|
    store.bucket = "db-backups"
    store.region = "eu-central-1"
  end
end

Credentials are absent on purpose. This file is committed, so the gem reads AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY from the backup environment, or falls back to an IAM role. See storage backends.

The schedule

# config/recurring.yml
production:
  boring_backup:
    class: BoringBackup::BackupJob
    schedule: every day at 3am

The entry goes under production:, so development and staging stay untouched. Existing entries are left alone: if the file already runs BoringBackup::BackupJob, the installer reports it and moves on.

A binstub

Optional, and only offered when a bin/ directory exists. It runs bundle binstubs boring-backup so you can type bin/bb backup without the bundle exec prefix.

Verify before you trust it

Run bb doctor on the machine where the credentials live. It is the difference between a backup you configured and a backup you know works.

$ bundle exec bb doctor

Further reading