Sapna Sharma
Sapna Sharma

Reputation: 754

Restore old data to new version of Postgres

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?

Upvotes: 2

Views: 2661

Answers (1)

Laurenz Albe
Laurenz Albe

Reputation: 248175

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.

Upvotes: 2

Related Questions