Recovering PostgreSQL
How to restore data from a previous PostgreSQL installation
Most of the sites talk about restoring data from backup created using pgdump or pgdumpall. Here are the steps one should keep in mind if they want to access their database from previous postgresql installation directory.
1. Check for the version of previous Postgresql installation.
(location of directory data under previous postgresql installation directory)
2. Check if it matches the current version i.e if the version of Postgresql from PG_VERSION file matches your current Postgresql installation
- >If the versions match, just clean start your postgresql using your old directory in the data path
Most of the sites talk about restoring data from backup created using pgdump or pgdumpall. Here are the steps one should keep in mind if they want to access their database from previous postgresql installation directory.
1. Check for the version of previous Postgresql installation.
/.../data/PG_VERSION
(location of directory data under previous postgresql installation directory)
2. Check if it matches the current version i.e if the version of Postgresql from PG_VERSION file matches your current Postgresql installation
- >If the versions match, just clean start your postgresql using your old directory in the data path
pg_ctl start -D /data path to previous installation/or alternatively you can use
postmaster -D /data path to previous installation/