0

Hello and excuse my english

Trying to push my postgres DB to heroku with the command:

heroku pg:push projectDB DATABASE_URL --app my_project_app67654

I got the message:

 !    Remote database is not empty.
 !    Please create a new database, or use `heroku pg:reset`

Then I used the command:

heroku pg:reset DATABASE_URL --app my_project_app67654

Which returned:

..Done

Then I used heroku pg:push again and the same error ocured again and again

Just to make sure, I logged in to the heroku database after resetting with:

heroku pg:psql --app my_project_app67654

And zero relation where there.

2 Answers 2

1

I was finally able to upload de DB to heroku doing the following

Note: Replace with the proper parameters

Backing up the local DB

$ pg_dump -U pg-user local-DB -f path-to-dump-file

Restoring the DB in heroku

$ heroku pg:psql -a heroku-app-name < path-to-dump-file

No idea about why the database is not empty error ocurred, but this worked fine for me

Sign up to request clarification or add additional context in comments.

2 Comments

I just followed the instructions given by the console and it worked just fine. Maybe the bug is already solved.
CREATE EXTENSION > ERROR: must be owner of extension plpgsql CREATE TABLE >ERROR: must be member of role "postgres" I encountered this error while following your command. How to fix this?
1

For windows to create dump DB you need execute the folowing command in cmd:

pg_dump -U loginDB -f "c:\dump" DB_name

c:\dump"- path to dump file.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.