Skip to content

chap/pgbackup-tasks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 

Repository files navigation

Some nice rake tasks for Heroku’s pgbackups

Allows you to do

$ rake pgbackup:seed       # capture pgbackup from production and load into development
$ rake pgbackup:to_staging # capture pgbackup from production and load into staging

Installation

  1. Add pgbackup-tasks to gemfile

    gem 'pgbackup-tasks'
    
  2. Bundle install

    $ bundle
  3. Make sure you’re using postgres for development.

    # config/database.yml
    development:
      adapter: postgresql
      database: myapp_development
      ...
  4. Make your heroku app’s remote names production and staging (as recommended in this heroku help article)

    # git/config
    [remote "production"]
      url = git@heroku.com:myapp.git
    
    [remote "staging"]
      url = git@heroku.com:myapp-staging.git
  5. Make sure you have the pgbackup add-on installed for your heroku apps.

    $ heroku addons:add pgbackups --remote production
    $ heroku addons:add pgbackups --remote staging
  6. Go for it!

    $ bundle exec rake pgbackup:seed

To Do

- add rails 2 support
- check to see that production and staging remotes are set (with nice warning)
- nice output (downloading, saving, restoring)
- hide "private" rake tasks
- silence pg_restore output
- figure out the best place to store backups

About

I don't use this anymore, the Heroku plugin pg:transfer is much better.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages