Received: from sss.sss.pgh.pa.us (sss.pgh.pa.us [206.210.65.6]) by hub.org (8.9.3/8.9.3) with ESMTP id LAA93470; Tue, 1 Jun 1999 11:36:39 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.sss.pgh.pa.us (8.9.1/8.9.1) with ESMTP id LAA21703; Tue, 1 Jun 1999 11:35:59 -0400 (EDT) To: Bob Kruger cc: pgsql-admin@postgreSQL.org, pgsql-general@postgreSQL.org, pgsql-sql@postgreSQL.org Subject: Re: [SQL] Data recovery In-reply-to: Your message of Tue, 01 Jun 1999 09:33:06 -0500 <3.0.5.32.19990601093306.00808e70@mindspring.com> Date: Tue, 01 Jun 1999 11:35:58 -0400 Message-ID: <21701.928251358@sss.pgh.pa.us> From: Tom Lane Bob Kruger writes: > I am recovering a system from a complete HD crash. > I have a backup of the Postgres data directory, e.g. > /usr/local/pgsql/data/base. > Is there a way or method to have Postgres pick these databases up again? > The version of Postgres run in this machine was/is 6.4.2. If you have a backup of the whole pgsql/data directory, just reinstall the same Postgres release, restore the data directory (instead of doing an initdb), and you should be in fat city. If you only have the data/base subdirectory, you will need to work harder; you'll have to regenerate the top-level files. I think if you get pg_shadow and pg_database right you will be OK. First, install and initdb to get a basic set of files. You will need to recall the old set of users (including their userIDs) in order to reconstruct pg_shadow. After you've done the createusers, issue a createdb for each old database (subdirectory of base/) so that they have entries in pg_database. Then, shut down the postmaster, blow away the contents of the base/ subdirectory and restore it from tape, and restart. I think it'll work... In any case it's critical to install the same Postgres version you were using. regards, tom lane