Forums

Restoring dump

When I try to restore a dump in my PA console, I get:

pg_restore: [archiver] unsupported version (1.13) in file header

https://stackoverflow.com/questions/49064209/getting-archiver-unsupported-version-1-13-in-file-header-when-running-pg-r

How can I fix that?

Where did you get the dump file from? You may need to get a new one that was generated with a pgdump that is compatible with the pg_restore we have installed.

pg_dump. My version is pg_dump (PostgreSQL) 10.3, yours?

I've checked and yours is 9.4.11 and mine 10.3.

How could we make it work?

You keep banning my IP ;(

Could you whitelist it: 92.234.36.21?

Thank you.

If you're making repeated failed ssh connection attempts, we'll block your IP to prevent brute forcing passwords. We're not going to turn that off.

If you just create a .sql dump. Like this:

pg_dump mydb > db.sql

you should be able to restore it with:

psql -d newdb -f db.sql

because that should just be a plain sql dump and so should not be version dependent.

I've tried but it works for 50%, I still get errors:

ERROR: unrecognized configuration parameter "row_security"

https://stackoverflow.com/questions/35447834/cannot-copy-postgresql-database-to-new-server-with-error-unrecognized-parameter

Do you know if it's possible to use an older version of pg_dump on my newer version of PostGres ?

Thank you.

The docs for pg_dump do list a bunch of arguments that you can use to exclude parts of the sql that might not be compatible. Have a look through the docs for your version of pg_dump to see what you can exclude from the dump.

HI. Just wanted to add that if you are doing pg_restore in the bash shell then you will need to put in your --host --port --username --dbname and file params or you will not be able to connect to the psql server from the bash shell in PA. because after i did that my pg_restore finally works :-)

Thanks! That's useful information to have in this thread :-)

Hello there. I am new to pythonanywhere. So I can't create a new file through dump.sql file. Can you help me?

I am getting the following error: connection to server on socket "/var/run/postgresql/.s.PGSQL.13538" failed: No such file or directory Is the server running locally and accepting connections on that socket?

You'll need to specify the hostname for the command on the command-line, for example by adding on -h something.something.pythonanywhere-services.com -- the actual hostname to use in place of the placeholder there is the name shown on the "Postgres" tab of the "Databases" page.