Re: How to transfer from place to plase without backup/restore

From: Shane Ambler <pgsql(at)Sheeky(dot)Biz>
To: Hristo Filipov <christod(at)ciela(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to transfer from place to plase without backup/restore
Date: 2007-10-23 08:58:27
Message-ID: 471DB7B3.1020704@Sheeky.Biz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hristo Filipov wrote:
> Is it possible to transfer database from one place to another without making
> backup from the source and restore at the target?
>
> I mean I want to copy the files as they are at the source to the target?
> What else I must do, so I can attach them to the target PostgreSQL database?

That is basically what you are doing when you transfer (unless you are
moving the drive to a new machine) - how you do the transfer will depend
on your needs and what hardware and software is at the source and
destination.

If you are looking for a backup server to be ready to use as soon as
your production server fails then you can look at PITR or
synchronization such as slony-1

If you want to copy your database to a development machine occasionally,
then if they have the same hardware and postgres version then you should
be able to copy the data files across while the production server is
stopped without problems. Some differences between CPU and postgres
version can stop this from working.

You could also do the dump/restore directly from one machine to another
if they are on the same network without having the dump file to transfer
across and import which will give similar results.

eg. instead of -
pg_dumpall > mybackupfile
psql -h my.other.machine.address < mybackupfile

you can -

pg_dumpall | psql -h my.other.machine.address

If you have different cpu's (one Intel and one AMD64) or different
postgres versions then you will have to do the dump/restore even if it
is sent straight from one to another.

For more help specify what hardware, system and postgres version you
have on each machine and what you wish to achieve in transferring.

--

Shane Ambler
pgSQL(at)Sheeky(dot)Biz

Get Sheeky @ http://Sheeky.Biz

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Goboxe 2007-10-23 09:17:53 print command in sproc
Previous Message Hristo Filipov 2007-10-23 08:27:53 How to transfer from place to plase without backup/restore