Answer the question
In order to leave comments, you need to log in
How to get postgres database from Ubuntu FS backup?
Hello! There was an ubuntu 14.04
VPS running postgres 9.3 .
Database is my_database , user is postgres , password is my_password .
Due to a weak SSH password, the VPS was hacked. The hosting provided a VPS backup and mounted it as /opt/backup
(the entire file system of the previous ubuntu with all data is available along this path)
The new VPS is also ubuntu 14.04, postgres is installed the same - 9.3.
path to old postgre - /opt/backup/etc/postgresql/9.3/main
path to new postgre - /etc/postgresql/9.3/main
Judging by the file
/opt/backup/etc/postgresql/9.3/main/postgresql.conf :
# The default values of these variables are driven from the -D command-line
# option or PGDATA environment variable, represented here as ConfigDir.
data_directory = '/var/lib/postgresql/9.3/main'
hba_file = '/etc/postgresql/9.3/main/pg_hba.conf'
ident_file = '/etc/postgresql/9.3/main/pg_ident.conf'
/opt/backup/var/lib/postgresql/9.3/main$ ls -al
total 56
drwxr-xr-x 2 postgres postgres 4096 May 15 06:06 .
drwxr-xr-x 3 postgres postgres 4096 May 15 06:06 ..
-rw-r--r-- 1 postgres postgres 315 May 15 06:06 environment
-rw-r--r-- 1 postgres postgres 143 May 15 06:06 pg_ctl.conf
-rw-r----- 1 postgres postgres 4719 Jun 17 09:47 pg_hba.conf
-rw-r----- 1 postgres postgres 1636 May 15 06:06 pg_ident.conf
-rw-r--r-- 1 postgres postgres 20669 Jun 17 09:29 postgresql.conf
-rw-r--r-- 1 postgres postgres 378 May 15 06:06 start.conf
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question