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

Posted on 2006-04-12
Last Modified: 2008-02-01
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
Question by:tariqf
    LVL 61

    Accepted Solution

    You can copy data directry on same version of server(OS platform included), but data will be damaged a bit.
    LVL 22

    Assisted Solution

    by:earth man2
    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
    LVL 61

    Expert Comment

    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.

    EE Cleanup Volunteer

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Best database to use for Maps is PostgreSQL. This is an open source database. Comes as a package with most Linux OS. For more info visit the following site: ( This requires some add-o…
    Many developers have database experience, but are new to PostgreSQL. It has some truly inspiring capabilities. I have several years' experience with Microsoft's SQL Server. When I began working with MySQL, I wanted a quick-reference to MySQL (htt…
    Steps to create a PostgreSQL RDS instance in the Amazon cloud. We will cover some of the default settings and show how to connect to the instance once it is up and running.
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now