[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 818
  • Last Modified:

restore a database from file-only backup of /var/lib/pgsql/

I need to restore some data from yesterday into my postgres database. I only have a filesystem backup each night so I have the full contents of /var/lib/pgsql which contains data, base, global etc. etc.

How do I copy my backup database folder into my currently running or maybe a spare server so that I can query yesterdays data to export back into the current db?

I think my databse is /var/lib/pgsql/data/base/156814 and my backup is on /mnt/buffalo/daily.0/var/lib/pgsql/data/base/156814

Please please can someone help it's pretty urgent!

Thanks in advance
0
tariqf
Asked:
tariqf
  • 2
2 Solutions
 
gheistCommented:
You can copy data directry on same version of server(OS platform included), but data will be damaged a bit.
0
 
earth man2Commented:
you can start another postmaster running but define the environment variable PGDATA to point to your backup data files.
You can then dump data using pg_dump
0
 
gheistCommented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.
I will leave the following recommendation for this question in the Cleanup topic area:

Split between gheist http:#16443602 and earthman2 http:#16459411

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

gheist
EE Cleanup Volunteer
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now