Thread
-
Moving Databases
Jeffrey Napolitano <jnapoli@setech.com> — 1998-07-09T20:52:15Z
I have two Postgresql databases - one on machine a, one on machine b. Both are currently running. I want to put a copy of the database on a onto machine b. I know I have to stop the postmaster (obviously) on database b, but what else is there to do? Which directories do I have to move (if that's what I have to do). Sorry - I know this is probably simple, but I'm rushing to meet a deadline. -- Jeffrey Napolitano Lowly Intern Software Emancipation Technology
-
Re: [GENERAL] Moving Databases
Maarten Boekhold <maartenb@dutepp2.et.tudelft.nl> — 1998-07-10T07:51:34Z
On Thu, 9 Jul 1998, Jeffrey Napolitano wrote: > I have two Postgresql databases - one on machine a, one on machine b. > Both are currently running. I want to put a copy of the database on a > onto machine b. I know I have to stop the postmaster (obviously) on > database b, but what else is there to do? Which directories do I have to > move (if that's what I have to do). Sorry - I know this is probably > simple, but I'm rushing to meet a deadline. On machine a: pg_dump database > db.out on machine b: cat db.out | psql template1 (both as postgres superuser). Maybe you gave to create the database first on machine b. At least, I think this should work.... And no need to stop any postmasters.. Maarten _____________________________________________________________________________ | TU Delft, The Netherlands, Faculty of Information Technology and Systems | | Department of Electrical Engineering | | Computer Architecture and Digital Technique section | | M.Boekhold@et.tudelft.nl | -----------------------------------------------------------------------------
-
Re: [GENERAL] Moving Databases
Chris Johnson <cmj@inline-design.com> — 1998-07-13T14:10:48Z
If you can access postgres on the second machine from the first (ie on machine a you can type "psql -h b database" and properly issue queries) you can just do the following from machine a pg_dump database | psql -h b database Chris On Fri, 10 Jul 1998, Maarten Boekhold wrote: > On Thu, 9 Jul 1998, Jeffrey Napolitano wrote: > > > I have two Postgresql databases - one on machine a, one on machine b. > > Both are currently running. I want to put a copy of the database on a > > onto machine b. I know I have to stop the postmaster (obviously) on > > database b, but what else is there to do? Which directories do I have to > > move (if that's what I have to do). Sorry - I know this is probably > > simple, but I'm rushing to meet a deadline. > > On machine a: > > pg_dump database > db.out > > on machine b: > > cat db.out | psql template1 > > (both as postgres superuser). Maybe you gave to create the database first > on machine b. > > At least, I think this should work.... And no need to stop any postmasters.. > > Maarten > > _____________________________________________________________________________ > | TU Delft, The Netherlands, Faculty of Information Technology and Systems | > | Department of Electrical Engineering | > | Computer Architecture and Digital Technique section | > | M.Boekhold@et.tudelft.nl | > ----------------------------------------------------------------------------- > >