Postgre database removal to other pc

PostgreSQL is the database server used to store information. Do you have a question or are you having problem with PostgreSQL? If so, post them here.

Moderator: Moderators

Postgre database removal to other pc

Postby hans32 » Mon Nov 24, 2008 5:43 am

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?
hans32
 
Posts: 52
Joined: Tue Nov 18, 2008 7:38 am

Re: Postgre database removal to other pc

Postby WhiteRider » Mon Nov 24, 2008 6:24 am

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?
WhiteRider
Moderator
 
Posts: 54018
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Postgre database removal to other pc

Postby hans32 » Mon Nov 24, 2008 7:24 am

2: yes it is a windows installation
hans32
 
Posts: 52
Joined: Tue Nov 18, 2008 7:38 am

Re: Postgre database removal to other pc

Postby hans32 » Mon Nov 24, 2008 9:19 am

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
hans32
 
Posts: 52
Joined: Tue Nov 18, 2008 7:38 am

Re: Postgre database removal to other pc

Postby kraada » Mon Nov 24, 2008 10:37 am

That sounds like it should work.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY


Return to PostgreSQL [Read Only]

Who is online

Users browsing this forum: No registered users and 28 guests

cron