1

My default Postgres (installed via brew) is at v14, and I can't start it because the files are at version 12:

DETAIL: The data directory was initialized by PostgreSQL version 12, which is not compatible with this version 14.0.

I can't upgrade the files:

==> Moving postgresql data back from /usr/local/var/postgres.old to /usr/local/var/postgres...
Error: Failure while executing; `/usr/local/opt/postgresql/bin/initdb --lc-collate=C --lc-ctype=C --lc-messages=C --lc-monetary=C --lc-numeric=C --lc-time=C -E\ UTF8 /usr/local/var/postgres` exited with 1.

There is also this error when I do brew services:

postgresql error /usr/local/opt/postgresql/homebrew.mxcl.postgresql.plist

I have version @12 installed but when I open it I can't see the databases in my default install.

What is the best path forward to resolve this?

fatfrog
  • 2,118
  • 1
  • 23
  • 46

1 Answers1

1

On your postgres 12 set the folder where the data you need (or a copy of this folder) as the working folder for postgres 12. Do pgdump on this version and then pg_restore on postgres 14.

Use the next link to identify the working folder:

Where does PostgreSQL store the database?

Jose Cabrera Zuniga
  • 2,348
  • 3
  • 31
  • 56