Uninstall / reinstall postgres on other hdd + keeping the db

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

Uninstall / reinstall postgres on other hdd + keeping the db

Postby TroyMcLure » Thu Jan 29, 2009 6:28 am

Hi there,

i have 4 huge mining dbs (45 gigs) + 1 played hands db in postgres. My problem is, that my hdd (partition) is running out of space so i want to uninstall postgres, keep the dbs, install postgres on another partition and finally copy-paste the dbs and "relink" them to/in the new installation (and PT3).
I found the (well written ^^) guide to uninstall/reinstall postgres and this should be not be problem in gerneral, but the guide assumes that postgres will be installed to the same directory as before (if i understood everything ;) ). What do i have to do to copy-paste the dbs? Simply paste them into the correct folders? Which folders in detail do i have to paste?

If it is possible to leave the postgres installation as it is and simply move the dbs to another partition and "relink" them in postgres (and PT3?), i would prefer this solution as this seems to be easier and my postgres-pt3-environment works quick and stable and disc space is my only problem.

Thanks in advance for any hints! :)
TroyMcLure
 
Posts: 10
Joined: Tue Sep 02, 2008 7:45 am

Re: Uninstall / reinstall postgres on other hdd + keeping the db

Postby TroyMcLure » Thu Jan 29, 2009 6:48 am

Ok, intensive(!) search in the forum > asking questions that are already answered :oops:

I haven't tried it yet, but this should solve my problem:
viewtopic.php?f=17&t=5718&p=26685&hilit=+move+dbs+another+partition#p26685

If not, let me say it with Arnie Schwarzeneggers words: I'll be back! ;)

Edit: For people who have the same problem: As far as i can see, solution two (leaving the installation and simply move and link the dbs) is not possible.
TroyMcLure
 
Posts: 10
Joined: Tue Sep 02, 2008 7:45 am

Re: Uninstall / reinstall postgres on other hdd + keeping the db

Postby LVgamb00ler » Fri Jan 30, 2009 3:52 am

Here's a link to a post I wrote about saving space for storing observed DB's.
http://www.pokertracker.com/forums/viewtopic.php?f=15&t=16258

As an update to that method:
The recent changes in PT3's cache table definition for beta 24 required that I restore the full observed hand DB's and re-run the update cache processing to create a new cache in the new format. Hopefully there will be few such changes in PT3.

One alternative is to create another tablespace, and move your observed DB's there. I'm not sure of all the steps required in this method. I briefly reviewed the Postgres docs and didn't see a method to ALTER database to change the TABLESPACE for an entire DB at one time. You may have to backup each DB, create a new DB with the new tablespace as part of its definition (create using pgAdmin not PT3), then restore to the new DB. Alternatively, you can use pgAdmin to change the tablespace for every table and index in your DB's. This will change the physical location of the stored table data. One caveat is that you must be careful using tablespaces as PT3 and routine backup/restore operations don't seem to preserve customized tablespace attributes.

I didn't have time to thoroughly research most of the above suggestions. I'd appreciate corrections of any errors or omissions I've made.

G'luck all,
LVgamb00ler
LVgamb00ler
 
Posts: 32
Joined: Thu Apr 03, 2008 7:57 pm
Location: Las Vegas


Return to PostgreSQL [Read Only]

Who is online

Users browsing this forum: No registered users and 19 guests

cron