Clark
Clark

Reputation: 3013

How to pg_restore a dump file generated from heroku to my local postgres 8 database?

I downloaded my latest backup file from heroku to my local drive using this command:

$ heroku pgbackups:capture
$ curl -o latest.dump `heroku pgbackups:url`

Then I tried to restore with:

$ pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myuser -d mydb latest.dump

And I got this error message:

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

After some googling, I found out that the problem is version mismatch. Heroku postgres version is 9.0.13, but my local dev database is version 8.0.

I'm a little hesitant to upgrade my local version to 9.0 because I had trouble with postgres installation before. Is there a simpler way to download data from heroku?

Upvotes: 2

Views: 4392

Answers (1)

Jon Mountjoy
Jon Mountjoy

Reputation: 4526

I know you don't want to, but I think what you really should do is upgrade your local postgres. Especially if you do any local development. You really want parity between your two environments. There are easier ways to install Postgres on some platforms - for example Postgres.app on OS X.

Upvotes: 1

Related Questions