1

I have looked through many answers on this but I can seem to understand why it's not working for me. I want to upload my local PostgreSQL DB to my rails app on Heroku.

I tried doing these commands (values replaced for obvious reasons):

  1. PGPASSWORD=[my db password] pg_dump -Fc --no-acl --no-owner -h localhost -U postgres [db name] > [db name].dump

Resulting in this error: 'PGPASSWORD' is not recognized as an internal or external command, operable program or batch file.

  1. heroku pg:push db_name [entire db url] --app app-name

I pulled the DB URL from the command heroku config --app app-name but said it was an unknown database and said a valid option was DATABASE_URL.

  1. I tried replacing [entire db url] with DATABASE_URL and it just gave me: The local psql command could not be located.

I have installed (and am currently running) PostgreSQL. My app launches and everything is good, for some reason my local DB values didn't transfer over to the app.

Any help is so greatly appreciated, thank you.

Jake
  • 1,086
  • 12
  • 38
  • 1
    If you're using free version of postgres in heroku you can't push your data. – Gokul P Jun 29 '18 at 19:22
  • @Gokulp Do I need to simply purchase a paid option on Heroku or actually purchase something from PostgreSQL? – Jake Jun 29 '18 at 19:26

1 Answers1

0

If you have paid version of heroku postgres db click here to push your data.

By default heroku won't allow to push data for free Dev postgres version.

If you have small size of db export all tables as CSV file then read push into the table.

Gokul P
  • 444
  • 1
  • 5
  • 18