Pashupati Sah
Pashupati Sah

Reputation: 586

ERROR: syntax error at or near "PGDMP" LINE 1: PGDMP

I am trying to upload a postgres database backup file to my hosting server. But I am getting these errors. No idea what is wrong with this file.enter image description here

Upvotes: 4

Views: 4493

Answers (2)

Pashupati Sah
Pashupati Sah

Reputation: 586

I got my the answer. Just backup in plain format rather than custom. Thanks for your effort.

Upvotes: 6

Kaumadie Kariyawasam
Kaumadie Kariyawasam

Reputation: 1476

You need to use a .sql file when uploading the database to your new stack. By default, Heroku gives you a .dump file. What worked for me was copying the database to my local development pg db using the .dump file and then using that to generate a .sql file which I pushed to my new app.

or

adapted to support the latest official dokku postgres plugin, pg_restore -O latest.dump | dokku postgres:connect <db_name>

Upvotes: 0

Related Questions