Skip to content

Instantly share code, notes, and snippets.

@wuputah
Created July 21, 2012 03:43
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wuputah/3154505 to your computer and use it in GitHub Desktop.
Save wuputah/3154505 to your computer and use it in GitHub Desktop.
#!/bin/bash
# ./clone-db COLOR from-app to-app plan
#
# example:
# ./clone-db COBALT my-production-app my-staging-app crane
#
# The COLOR is used for a grep on your config var output, so make sure it's unique.
color=$1
src=$2
dest=$3
plan=$4
heroku addons:add heroku-postgresql:$plan --fork "$(heroku config --shell -a $src | grep $color | cut -d = -f 2)" -a $dest
@kennethreitz
Copy link

🍰

@wuputah
Copy link
Author

wuputah commented Jul 21, 2012

Recent version of the Heroku toolbelt required. Latest is 2.29.0 - check heroku version, run heroku update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment