2

I'm trying to upload my development data to my heroku site database -

I followed this guide:

How can I upload a DB to Heroku

I got the following error:

Please add the pgbackups addon first via:

heroku addons:add pgbackups

I ran the command above and got:

WARNING: heroku addons:add has been deprecated. Please use heroku addons:create instead. ! No such add-on plan.

I ran the command "heroku addons:create pgbackups" and got:

!    No such add-on plan.

I don't know what to do?

Community
  • 1
  • 1
brad
  • 491
  • 1
  • 9
  • 24
  • possible duplicate of [How can I upload a DB to Heroku](http://stackoverflow.com/questions/14500631/how-can-i-upload-a-db-to-heroku) – Andrew Lavers May 09 '15 at 20:24
  • it is not a duplicate.. i also gave a link to that question - i followed that guide but it gave me errors.. – brad May 10 '15 at 06:21

2 Answers2

2

The guide you're following is outdated, the pgbackups addon has been deprecated.

Here's the guide you're looking for: https://devcenter.heroku.com/articles/heroku-postgres-backups

heroku pg:backups restore 'https://s3.amazonaws.com/me/items/mydb.dump' DATABASE -a sushi
Andrew Lavers
  • 8,023
  • 1
  • 33
  • 50
2

For creating database type the following command inside your project :
heroku addons:create heroku-postgresql:hobby-dev

And after that type the following command to create a dump file of your local database:

pg_dump -h [host] -d [dbname] -p [port] -U [username] -F c -f [filename]
e.g. , pg_dump -h 127.0.0.1 -p 5432 -U postgres -F c -f dumpfile

where , filename = output file name , -F is for output file format (c=custom)

On typing this command you will be asked for a password . Type the password of your local database.

The file with name of [filename] will be created.

Now you need to upload this file on amazon s3.

Type the following command to import your local database dump file into your heroku database. Use the link of your uploaded file in the command.

heroku pg:backups:restore "https://s3.amazonaws.com/me/items/3H0q/mydb.dump" DATABASE_URL

reference : https://devcenter.heroku.com/articles/heroku-postgresql https://devcenter.heroku.com/articles/heroku-postgres-import-export#import

Ekta
  • 21
  • 3