How can i keep my databases when installing PostgreSQL ?

Поиск
Список
Период
Сортировка
Искать

How can i keep my databases when installing PostgreSQL ?

От:
Josef Springer <Josef.Springer@joops.com>
Дата:
Hello everybody,

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 ?

Can anybody help me ?

Best regards,

Josef Springer

Re: How can i keep my databases when installing PostgreSQL ?

От:
Kevin Grittner <kgrittn@ymail.com>
Дата:
Josef Springer  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

FAQ