Search Postgresql Archives

Re: recovering database from a linux file system

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx
[mailto:pgsql-general-owner@xxxxxxxxxxxxxx] On Behalf Of John R Pierce
Sent: Thursday, March 10, 2016 12:10 PM
To: pgsql-general@xxxxxxxxxxxxxx
Subject: Re:  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@xxxxxxxxxxx


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux