Question

I'm trying to upgrade my heroku db, but the command the help section tells me to use:

https://devcenter.heroku.com/articles/upgrade-heroku-postgres-with-pgbackups

Is not available on my tools.

Here's the commands I've input so far:

pc$ heroku addons:add pgbackups
  Adding pgbackups on heroku-app-1111... done, v152342344 (free)
  You can now use "pgbackups" to backup your databases or import an external backup.
  Use `heroku addons:docs pgbackups` to view documentation.
pc$ heroku addons:add heroku-postgresql:hobby-basic
  Adding heroku-postgresql:hobby-basic on heroku-app-1111... done, v14434455 ($9/mo)
  Attached as HEROKU_POSTGRESQL_BROWN_URL
  Database has been created and is available
  ! This database is empty. If upgrading, you can transfer
  ! data from another database with pgbackups:restore.
  Use `heroku addons:docs heroku-postgresql` to view documentation.
pc$ heroku maintenance:on
  Enabling maintenance mode for heroku-app-1111... done
pc$ heroku ps:scale worker=0
  Scaling dynos... done, now running worker at 0:1XX.
pc$ heroku pgbackups:transfer HEROKU_POSTGRESQL_BROWN
!    `pgbackups:transfer` is not a heroku command.
!    See `heroku help` for a list of available commands.

Listing the commands for heroku pgbackups effectively does not have the transfer command. Any ideas?

Was it helpful?

Solution 2

I'm assuming you want to clone your current database to a new database that you've added onto your app? Below, assume HEROKU_POSTGRESQL_PINK is your original database, and HEROKU_POSTGRESQL_BROWN is the new one you just added.

Then the steps you want to do are the following:

  1. backup your old database on your app heroku pgbackups:capture HEROKU_POSTGRESQL_PINK
  2. restore your backup to your new database URL=$(heroku pgbackups:url HEROKU_POSTGRESQL_PINK) && heroku pgbackups:restore HEROKU_POSTGRESQL_BROWN $URL
  3. it will ask you to confirm, you have to re-type the database name to confirm it.

OTHER TIPS

Your Heroku client is out of date. Run 'heroku update'. I know that pgbackups:transfer is not available in 3.3.0 and it is available in 3.8.4.

I ran into the same problem and ended up doing the following:

1) backup the database

heroku pgbackups:capture --expire

2) find the id of the backup with

heroku pgbackups

3) find the url of the backup with (replace ID with something like b020)

heroku pgbackups:url ID

4) restore the backup to the destination database with

heroku pgbackups:restore HEROKU_POSTGRESQL_NEWCOLOR "https://your-pgbackup-url.com"

5) promote your new db

heroku pg:promote HEROKU_POSTGRESQL_NEWCOLOR

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top