Skip to content

Instantly share code, notes, and snippets.

@afmicc
Created September 27, 2019 13:48
Show Gist options
  • Save afmicc/e6acb7811c39bedb2a6f564767771d84 to your computer and use it in GitHub Desktop.
Save afmicc/e6acb7811c39bedb2a6f564767771d84 to your computer and use it in GitHub Desktop.
Heroku - Copy database to another app
# get git remote url names
git remote -v
# create back up at old app
heroku pg:backups:capture --remote origin-remote-name-url
heroku pg:backups:download --remote origin-remote-name-url # optional
# get backup url
heroku pg:backups:url --remote origin-remote-name-url # return s3-amazon-url
# restore backup at new app
heroku pg:backups:restore '<s3-amazon-url>' DATABASE_URL --remote destination-remote-name-url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment