Re: Reloading data

Lists: pgsql-novice
From: Damon Courtney <damon(at)your(dot)unreality(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Reloading data
Date: 2003-09-05 16:45:01
Message-ID: Pine.BSF.4.21.0309051142170.58350-100000@your.unreality.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

Is there some easy way I can take an old PGDATA directory and load
it into a new instance of Postgres? My server was rebuilt, and I didn't
get a chance to dump the database to restore it in the new server.

Will copying the old data directory into the new server really screw
things up? Is there some method by which I can somehow "import" data from
those old data files into the new server?

Thanks,

Damon


From: Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net>
To: PgSQL Novice ML <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Reloading data
Date: 2003-09-06 21:35:08
Message-ID: 1062884108.17057.344.camel@haggis
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

On Fri, 2003-09-05 at 11:45, Damon Courtney wrote:
> Is there some easy way I can take an old PGDATA directory and load
> it into a new instance of Postgres? My server was rebuilt, and I didn't
> get a chance to dump the database to restore it in the new server.

Thus, again, we learn the necessity of *regular*, *frequent* backups.

> Will copying the old data directory into the new server really screw
> things up? Is there some method by which I can somehow "import" data from
> those old data files into the new server?

Was the DB cleanly shutdown when the "OS" backup was taken? If
so, then, if the config files are the same as before, and you put
it all back in the same directory tree, it might/should work.

--
-----------------------------------------------------------------
Ron Johnson, Jr. ron(dot)l(dot)johnson(at)cox(dot)net
Jefferson, LA USA

"...always eager to extend a friendly claw"


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Damon Courtney <damon(at)your(dot)unreality(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Reloading data
Date: 2003-09-07 01:05:39
Message-ID: 683.1062896739@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

Damon Courtney <damon(at)your(dot)unreality(dot)com> writes:
> Is there some easy way I can take an old PGDATA directory and load
> it into a new instance of Postgres? My server was rebuilt, and I didn't
> get a chance to dump the database to restore it in the new server.

Only if it's the samw Postgres version, and you want to replace the
whole installation (entire contents of PGDATA).

> Will copying the old data directory into the new server really screw
> things up? Is there some method by which I can somehow "import" data from
> those old data files into the new server?

It sounds like you want to merge with stuff you already have in the new
server, rather than just blow it away and replace the installation with
the old PGDATA contents. I'd suggest that you fire up a postmaster of
the appropriate version in the old PGDATA directory, run pg_dumpall, and
load the dump file into the new server.

regards, tom lane