1

As I was installing osm2pgsql with Homebrew, brew started updating my Postgres from 10.8 to 11.3. After installation, the process, the upgrade of database failed.

Error: Upgrading postgresql data from 10 to 11 failed!
==> Removing empty postgresql initdb database…
==> Moving postgresql data back from /usr/local/var/postgres.old to /usr/local/v
==> Successfully started postgresql (label: homebrew.mxcl.postgresql)
Error: Failure while executing; /usr/local/opt/postgresql/bin/pg_upgrade -r -b /usr/local/Cellar/postgresql@10/10.8/bin -B /usr/local/opt/postgresql/bin -d /usr/local/var/postgres.old -D /usr/local/var/postgres -j 12 exited with 1.

I have also received this message in one of the log files, which I think explains the problem:

“pg_dump: [archiver (db)] query failed: ERROR: could not access file “$libdir/postgis-2.4”: No such file or directory”

I am using MacOS Mojave, PosgreSQL and PostGIS and not really good with terminal. Could anyone help me get my database back?

Tetsujin
  • 47,296
  • 8
  • 108
  • 135
  • Looking more carefully it seems like, brew has added a new folder "/user/local/var/postgresql@10", but next to it is "/user/local/var/postgres", which is a huge folder. Is this where my data has gone? – redsoundcircle Jun 21 '19 at 13:59
  • I am putting a comment here to bring this up. I really need to get my data back, and any help would be appreciated. Is there for example, a way to do this update manually? Or get the data and import it into other databases (I had several databases on my Postgres) Thanks – redsoundcircle Jul 12 '19 at 18:21

0 Answers0