Re: How can i keep my databases when installing PostgreSQL ? - Mailing list pgsql-admin

From Kevin Grittner
Subject Re: How can i keep my databases when installing PostgreSQL ?
Date
Msg-id 217776053.3846435.1424615245759.JavaMail.yahoo@mail.yahoo.com
Whole thread Raw
In response to How can i keep my databases when installing PostgreSQL ?  (Josef Springer <Josef.Springer@joops.com>)
List pgsql-admin
Josef Springer <Josef.Springer@joops.com> wrote:

> i must reinstall PostgreSQL, because the installed server does not
>    work anymore. Because of lost disk sectors the server can not be
>    started in the system-services GUI. The result of the starting
>    request is
> "Fehler 1053 Der Dienst antwortet nicht auf die Start oder
>     Steueranweisung"
>
> What is the doing to preserve existing databases, when reinstalling
>     PostgreSQL ?

First, copy the data directory tree to some safe medium.

https://wiki.postgresql.org/wiki/Corruption

The exact steps required after installing new software are going to
vary somewhat depending on the OS and the installer used.  Once the
software is there you will either need to set up a service script
pointing to the data directory or copy the data directory in place
of what the installer sets up.

Once you are able to start the database service, I would recommend
that you immediately pg_dump of all databases and restore them to a
freshly created cluster.  I would only put that new cluster on the
old machine if I was confident that the cause of the storage
failure had been found and fixed.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-admin by date:

Previous
From: Josef Springer
Date:
Subject: How can i keep my databases when installing PostgreSQL ?
Next
From: Drazen Kacar
Date:
Subject: Re: Query cancellation on hot standby because of buffer pins