Page 1 of 1

Postgre database removal to other pc

PostPosted: Mon Nov 24, 2008 5:43 am
by hans32
hi


I have a few question I hope you guys can answer:

1: I wish to move database to another pc. How can i transfer data otherwise that using Import hand history feature? Can I copy the postgres folder from c-drive to new pc, and then expect database to run on new pc?

2: is there a way to automatically create backup of postgres sql database using a script, and how do I do it?

Re: Postgre database removal to other pc

PostPosted: Mon Nov 24, 2008 6:24 am
by WhiteRider
1. Have a look at the Database / Postgres FAQ which explains how to backup and restore your database to another computer.

2. I'm sure you can do this - I don't know exactly how, but I'm sure one of our postgres experts will tell you. Is your postgres install on Windows?

Re: Postgre database removal to other pc

PostPosted: Mon Nov 24, 2008 7:24 am
by hans32
2: yes it is a windows installation

Re: Postgre database removal to other pc

PostPosted: Mon Nov 24, 2008 9:19 am
by hans32
Make a .bat file with these lines to automatically back up db:

cd C:\Program Files\PostgreSQL\8.3.5.1\bin
pg_dump.exe -h localhost -p 5432 -U postgres -F c -b -v -f "C:\backup.backup" "PT3 DB"

First line browse to postgres folder
Second line backup database to: "C:\backup.backup", named PT3 DB

Re: Postgre database removal to other pc

PostPosted: Mon Nov 24, 2008 10:37 am
by kraada
That sounds like it should work.

highfalutin