Re: recovering database from a linux file system

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: recovering database from a linux file system
Дата
Msg-id 56E1DFF5.5020509@aklaver.com
обсуждение исходный текст
Ответ на Re: recovering database from a linux file system  (Alka Gupta <alka.gupta@broadcom.com>)
Список pgsql-general
On 03/10/2016 12:25 PM, Alka Gupta wrote:
> Thank you John!
>
> Do you know if there is any encryption or security or will plainly copying
> the files will work? Do I need to know any db usernames and passwords, which
> obviously I don't have?

The files should not be encrypted. There will be database usernames and
possibly passwords. I would assume the usual default superuser name
postgres. To get around the password see pg_hba.conf:

http://www.postgresql.org/docs/9.5/interactive/auth-pg-hba-conf.html

In particular you want the below at the top of the entries, assuming you
are connecting on from the same machine as the server:

local   all             all                                     trust

The above says just trust anyone connecting over the local socket.
Assuming you get in then:

\du postgres
role name |                   Attributes                   | Member of
-----------+------------------------------------------------+-----------
  postgres  | Superuser, Create role, Create DB, Replication | {}


to verify you are superuser and then:

select * from pg_shadow ;

to see the users and whether they have passwords.

>
>
>
> -----Original Message-----
> From: pgsql-general-owner@postgresql.org
> [mailto:pgsql-general-owner@postgresql.org] On Behalf Of John R Pierce
> Sent: Thursday, March 10, 2016 12:10 PM
> To: pgsql-general@postgresql.org
> Subject: Re: [GENERAL] recovering database from a linux file system
>
> On 3/10/2016 12:05 PM, Alka Gupta wrote:
>> The vendor won't give us any way to access the machine and retrieve
>> the DB, so I removed the HDD and connected it to my Linux laptop.  I
>> was able to grab all the DB files and copy them to my Windows desktop,
>> where I then installed PostgreSQL 9.0 (to match the version that was
>> on the server) with pgAdmin III.  I changed the default directory to
>> the folder containing the DB files using this tutorial:
>> https://wiki.postgresql.org/wiki/Change_the_default_PGDATA_directory_o
>> n_Windows
>
>
> I would try installing postgres on linux, and try running it with a copy
> of this data directory.   skip the pgadmin thing entirely as its just
> another layer of obfuscation, stick with CLI tools.
>
>
>
> --
> john r pierce, recycling bits in santa cruz
>
>
>


--
Adrian Klaver
adrian.klaver@aklaver.com


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

Предыдущее
От: Karsten Hilbert
Дата:
Сообщение: Re: pg_restore without dropping db/table
Следующее
От: Melvin Davidson
Дата:
Сообщение: Re: pg_restore without dropping db/table