How to migrate data from one Heroku app to another - brownfield-team/anacapa-github-linker GitHub Wiki

This is a summary page for what can be found in the heroku docs.

This assumes that you've properly configured/logged into your heroku cli.

You can then run the command listed below.

  • Note that DATABASE_URL should be left as is, not replaced.
  • However SOURCE-APP-NAME, DESTINATION-APP-NAME, and b000 should be replaced with the correct values everywhere they appear.
    • b000 is the backup number that can be found on the heroku backups dashboard.
heroku pg:backups:restore `heroku pg:backups:url --app SOURCE-APP-NAME` DATABASE_URL --app DESTINATION-APP-NAME --confirm DESTINATION-APP-NAME

OR

heroku pg:backups:restore SOURCE-APP-NAME::b000 DATABASE_URL --app DESTINATION-APP-NAME --confirm DESTINATION-APP-NAME