This question is an exact duplicate of:
I have a tar archive with full backup of my CentOS filesystem with pg9.1 installed. How can I restore one database from it?
This question is an exact duplicate of: I have a tar archive with full backup of my CentOS filesystem with pg9.1 installed. How can I restore one database from it? |
|||
migrated from stackoverflow.com Mar 15 at 1:14This question came from our site for professional and enthusiast programmers. marked as duplicate by Paul White, RolandoMySQLDBA, Mark Storey-Smith, Kin, ypercube Apr 16 at 10:44This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question. |
|||
You will need a locally installed PostgreSQL of the same major as the data directory archive. For example, if the archive came from 9.1.5 you would need some 9.1.x on the local machine, it doesn't matter if it's 9.1.0 or 9.1.9, but it must be 9.1 not 9.2 or 9.0. If you don't have 9.1, you can install it from packages or just download the source and compile it locally. Then, if you just want to dump the data to reload into an existing local PostgreSQL install:
If you instead want to restore the database so it runs instead of whatever's locally running, you must:
Some details like service name, path, etc will vary depending on whether you're running the original Red Hat packages of PostgreSQL, or whether you installed from http://yum.postgresql.org/ . |
|||||||||
|
* Error: could not exec /usr/lib/postgresql/9.1/bin/pg_ctl /usr/lib/postgresql/9.1/bin/pg_ctl start -D /var/lib/postgresql/9.1/main -l /var/log/postgresql/postgresql-9.1-main.log -s -o -c config_file="/etc/postgresql/9.1/main/postgresql.conf" :
And, after restoring backup to right place I still get this error. WTF? – asiniy Mar 16 at 5:00