Skip to content

Instantly share code, notes, and snippets.

@wuputah
Created July 21, 2012 03:43
Show Gist options
  • Select an option

  • Save wuputah/3154505 to your computer and use it in GitHub Desktop.

Select an option

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
@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