On Fri, Nov 13, 2020 at 1:56 PM Maksim Fomin <maxim@xxxxxxxxx> 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.