2

I have postgres installed on a server (version 9.3). I plan to change server and update Postgres to new version. In my new server I have Postgres v.12

I have copied the raw data files from old server to new server. Data is pasted in folder /var/lib/postgres/12/main/

I am not able to see databases in new server with command /l

What steps should I take to restore these databases to newer versions from raw data file folder?

Sapna Sharma
  • 722
  • 1
  • 8
  • 19
  • This does not look programming related to me - but why not dump the data from the old server, and import it in the new one? – Nico Haase Feb 25 '21 at 12:48
  • This is related to postgres programming :? Dump and restore is not option due to space constraint. https://stackoverflow.com/questions/66356435/genrating-postgres-dump-and-saving-to-another-server – Sapna Sharma Feb 25 '21 at 13:00
  • Why not use `pg_upgrade`? – Hambone Feb 25 '21 at 13:10

1 Answers1

2

That won't work.

You have to start a PostgreSQL 9.3 server on that data directory, run pg_dumpall to extract the data (perferrably with pg_dumpall from the v12 installation!), and restore the dump into the v12 server.

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263