Re: Restoring database from false update

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Restoring database from false update
Дата
Msg-id CAKFQuwZqNw0zMRiNTqJ2pxsshxVG9no0XpMHLW07MeJC6w0f6g@mail.gmail.com
обсуждение исходный текст
Ответ на Restoring database from false update  (Maksim Fomin <maxim@fomin.one>)
Ответы Restoring database from false update  (Maksim Fomin <maxim@fomin.one>)
Список pgsql-general
On Fri, Nov 13, 2020 at 1:56 PM Maksim Fomin <maxim@fomin.one> wrote:
Later, I stopped the service and moved backup folder to the usual place. For some reason psql shows that there are no relations found in the database, although the database is listed. My next step was to copy data from file-system level backup (about 4-5 days ago) but the result was the same.

How I can restore the database?

Assuming you have a complete and valid v12 data directory backup created from a shutdown server, and containing good WAL files...and that the server is presently running a v12 instance of PostgreSQL you are able to connect to using psql.

What do the following show?

select version();
show data_directory;

Assuming that the version is 12.x you want to ensure that your data directory backup replaces the entire contents of wherever data_directory is pointing (while the PostgreSQL process is stopped).

Having done that, and starting the server back up, you should find the old cluster to have been restored.

If that doesn't work:

Reviewing log files can help.

If you can report the startup command that is run to launch the postgres process that would help too.

Showing before and after directory structures can help.

David J.

В списке pgsql-general по дате отправления:

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: New "function tables" in V13 documentation
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Range partitioning and overlap