Greetings Basically I have a problem here. I lost my linux system due to
hard drive corruption I managed to back up my /var/lib/pgsql/data/base
directory to an ordinary tarball before I redid the system. Is there any
way to use this data as a backup?
and what is the proceedure for a proper backup?

Search Discussions

  • Duncan Adams (DNS) at Nov 20, 2001 at 12:50 pm
    I guess one could try pg_dump but I am still a green eared newbie so don't
    take my word for it.

    -----Original Message-----
    From: Danni Coy
    Sent: Thursday, November 22, 2001 8:15 PM
    To: pgsql-novice@postgresql.org
    Subject: [NOVICE] Emergency backup question.


    Greetings Basically I have a problem here. I lost my linux system due to
    hard drive corruption I managed to back up my /var/lib/pgsql/data/base
    directory to an ordinary tarball before I redid the system. Is there any
    way to use this data as a backup?
    and what is the proceedure for a proper backup?


    ---------------------------(end of broadcast)---------------------------
    TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
  • Tom Lane at Nov 20, 2001 at 3:21 pm

    Danni Coy writes:
    Greetings Basically I have a problem here. I lost my linux system due to
    hard drive corruption I managed to back up my /var/lib/pgsql/data/base
    directory to an ordinary tarball before I redid the system. Is there any
    way to use this data as a backup?
    If you only backed up that subdirectory, and not all of
    /var/lib/pgsql/data, I'm afraid you're out of luck. You needed the
    pg_log files too.
    and what is the proceedure for a proper backup?
    Routine pg_dump runs are recommended. You might care to consult the
    discussion of backup procedures in the Administrator's Guide,
    http://www.ca.postgresql.org/users-lounge/docs/7.1/postgres/backup.html
    or the updated version in development docs,
    http://candle.pha.pa.us/main/writings/pgsql/sgml/backup.html

    regards, tom lane
  • Josh Berkus at Nov 20, 2001 at 4:41 pm
    Danni,
    Greetings Basically I have a problem here. I lost my linux system due to
    hard drive corruption I managed to back up my
    /var/lib/pgsql/data/base
    directory to an ordinary tarball before I redid the system. Is there any
    way to use this data as a backup?
    Not really. As Tom said, without some of the other files, a backup of
    just the /base subdirectory is nigh on useless.

    If, however, this was mission-critical information requiring many hours
    of your time to recover, you can recover a certain amount of your data
    by reading the tables directly using a text editor. However, this is
    very labor-intensive and tends to only allow you to recover the integer,
    numeric, and short VARCHAR fields; the rest of the fields often get
    compressed.

    -Josh


    ______AGLIO DATABASE SOLUTIONS___________________________
    Josh Berkus
    Complete information technology josh@agliodbs.com
    and data management solutions (415) 565-7293
    for law firms, small businesses fax 621-2533
    and non-profit organizations. San Francisco
  • Brian at Nov 20, 2001 at 5:42 pm
    My take on the documentation that I just read is that you have a filesystem backup of the data if you have everything at and below the pgsql/data directory...

    ---- to quote the docs --------

    An alternative backup strategy is to directly copy the files that Postgres uses to store the data in the database. In Section 3.2 it is explained where these files are located, but you have probably found them already if you are interested in this method. You can use whatever method you prefer for doing usual file system backups, for example

    tar -cf backup.tar /usr/local/pgsql/data

    There are two restrictions, however, which make this method impractical, or at least inferior to the pg_dump method:

    The database server must be shut down in order to get a usable backup. Half-way measures such as disallowing all connections will not work as there is always some buffering going on. For this reason it is also not advisable to trust file systems that claim to support "consistent snapshots". Information about stopping the server can be found in Section 3.6.

    Needless to say that you also need to shut down the server before restoring the data.

    -- end quote --------
    At 05:15 AM 11/23/01 +1100, Danni Coy wrote:
    Greetings Basically I have a problem here. I lost my linux system due to
    hard drive corruption I managed to back up my /var/lib/pgsql/data/base
    directory to an ordinary tarball before I redid the system. Is there any
    way to use this data as a backup?
    and what is the proceedure for a proper backup?


    ---------------------------(end of broadcast)---------------------------
    TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-novice @
categoriespostgresql
postedNov 20, '01 at 12:17p
activeNov 20, '01 at 5:42p
posts5
users5
websitepostgresql.org
irc#postgresql

People

Translate

site design / logo © 2022 Grokbase