Re: db not dumping properly, or at least not restoring - Mailing list pgsql-general

From Scott Marlowe
Subject Re: db not dumping properly, or at least not restoring
Date
Msg-id dcc563d10910170248i81243d4obb5177763cb8bf77@mail.gmail.com
Whole thread Raw
In response to Re: db not dumping properly, or at least not restoring  (Kirk Wythers <kwythers@umn.edu>)
List pgsql-general
On Fri, Oct 16, 2009 at 6:11 PM, Kirk Wythers <kwythers@umn.edu> wrote:
> On Oct 16, 2009, at 4:51 PM, Scott Marlowe <scott.marlowe@gmail.com> wrote:
>
>> On Fri, Oct 16, 2009 at 11:25 AM, Kirk Wythers <kwythers@umn.edu> wrote:
>>
>>> Any ideas what the problem could be here?
>>
>> Use the pg_dump from the target (i.e. newer) pgsql.  I.e. if going
>> from 8.3.8 to 8.4.1, use the pg_dump that comes with 8.4.1 to dump the
>> 8.3.8 database.
>>
> Can I assume that this is even more critical if gong from 8.2 to 8.4?

About the same really.  Always use the newer / target pg version pg_dump

>> I usually just do it like so:
>>
>> (First migrate accounts:)
>> pg_dumpall --globals -h oldserver | psql -h newserver postgres
>
> I'm a little confused here. Are you saying to used the network connections
> between thetwo servers and to pipe the dumpall directly to the psql load?

Yes.  Note that I'm using pg_dumpall to get JUST the accounts (i.e. --globals)

>> (then each database:)
>> createdb -h newserver dbname
>
> Then create new databases on the the new server to match the. The names from
> the old server?

Yep.

>> pg_dump -h oldserver dbname | psql -h newserver dbname
>> (repeat as needed, save output for error messages)
>
> Then dump each database individually and pipe the dump to the psql load?

Yep.

> These two procedures seem to duplicate the goal? Or am I mosaic something?

No, dumpall --globals is just to migrate the accounts over first.

pgsql-general by date:

Previous
From: Gerhard Wiesinger
Date:
Subject: Re: 10/13 SFPUG meeting, "The Mighty GUCS," video now available
Next
From: Raymond O'Donnell
Date:
Subject: Re: slightly off-topic: Central Auth