At 09:17 31/10/01, you wrote:
>I have data in a postgres database on one server and have to move it to a
>new server that has been set up with a new version of postgres. The
>database is an exact copy. what is the best way of moving the thing across?
>do i set up the tables on the new box and write scripts to move it across or
>is there another way of doing this?
Easiest way would be to dump the database to a text file:
% pg_dump yourdatabase > /path/to/dumpfile
copy it to the new server, and read it to an empty database using psql -e:
% psql -e yourdatabase < /newpath/to/dumpfile
This way all the schema are recreated, and the data loaded into them,
automatically -- you don't have to set anything up by hand. See the
documentation on pg_dump for more information.
Digital Mind Games -- log on to take over
pgsql-novice by date
|Next:||From: Einar Karttunen||Date: 2001-10-31 09:51:31|
|Subject: Re: moving postgres data|
|Previous:||From: Duncan Adams (DNS)||Date: 2001-10-31 09:17:01|
|Subject: moving postgres data|