Skip to content

Instantly share code, notes, and snippets.

@rcackermanCC
Last active August 29, 2015 14:15
Show Gist options
  • Select an option

  • Save rcackermanCC/37e0f35e4a4cf4a1e486 to your computer and use it in GitHub Desktop.

Select an option

Save rcackermanCC/37e0f35e4a4cf4a1e486 to your computer and use it in GitHub Desktop.
Create a new Heroku instance of an existing app
heroku apps:create <new instance name>
git remote add <remote name> <new url>
git push <remote name>
heroku addons:add heroku-postgresql:hobby-dev --app <new instance name>
heroku addons:add pgbackups --app <new instance name>
heroku run rake db:setup --app <new instance name>
heroku pgbackups:capture --app <original instance name>
heroku pgbackups:restore <new instance postgres url> `heroku pgbackups:url <backup id> --app <old instance>` --app <new instance>

Get database info for new and old instances:

heroku pg:info --app <name>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment