Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pgbackups:transfer is not a heroku command

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?

like image 877
wachichornia Avatar asked Mar 20 '23 16:03

wachichornia


2 Answers

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.

like image 97
lincolnq Avatar answered Mar 29 '23 20:03

lincolnq


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.
like image 22
derekyau Avatar answered Mar 29 '23 20:03

derekyau