Re: moving postgres data
От | Mo Holkar |
---|---|
Тема | Re: moving postgres data |
Дата | |
Msg-id | 5.1.0.14.2.20011031094122.04a02910@pop.ntlworld.com обсуждение исходный текст |
Ответ на | moving postgres data ("Duncan Adams (DNS)" <duncan.adams@vcontractor.co.za>) |
Список | pgsql-novice |
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. best, Mo Mo Holkar Digital Mind Games -- log on to take over mo.holkar@digitalmindgames.com http://www.digitalmindgames.com
В списке pgsql-novice по дате отправления: