0
votes

I am trying to shift from heroku to amazon aws and after I dumped the db using:

heroku pg:backups:capture
heroku pg:backups:download

I ran:

eb ssh
cd /var/app/current    
pg_restore -v -h $NAME.$ID.$DATACENTER.rds.amazonaws.com -U $RDS_ROOT_USER -d $DATABASE_NAME latest.dump

I get the following error:

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

BTW I am using rails.

What am I doing wrong?

1
Which postgres version are you using?Abhishek Kushwaha
@AbhishekKushwaha 9.2.4Jason.moon
I fell into same situation, upgrading your postgres version of RDS instance will fix this issue.Abhishek Kushwaha
@AbhishekKushwaha I selected the RDS instance and updated the postgres version to 11.4-R1 and tried again but it didn't workJason.moon
Are you getting the same error? If not, please put your error here.Abhishek Kushwaha

1 Answers

0
votes

You're using an old version of pg_restore binary that doesn't support restoring the provided dump file. Please make sure that you use the latest Postgres version, which must be higher than the following release: https://www.postgresql.org/about/news/1834/ (10.3, 9.6.8, 9.5.12, 9.4.17, and 9.3.22).

You can check the pg_restore version you're using by running pg_restore --version.

If you are using a third-party tool, such as PgAdmin, to restore the provided dump file, the restore may not succeed even with the installed Postgres version being up to date. This is due to third-party tools often bundling their own versions of the pg_restore binary, that may not be up to date.

Follow this link: Why am I getting pg_restore