Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 505
  • Last Modified:

Manually Importing Tablespaces from Postgres 8.0 beta-1 to Postgres 8.0 (for windows)

Hi All!  Here's my problem, last year I setup an application on a pc running windows XP-Pro.  The application uses JSP and PostgreSQL as its database.  Last friday, the motherboard of the pc crashed due to age (its been around a long time).. we got it replaced, but unfortunately I'm getting the blue screen from XP Pro everytime I boot up, and during safe mode the pc just reboots entirely.

So is the hard drive was still intact I just opted to just extract the postgres data from it and just reformat the pc.  I was able to copy over the entire postgres folder from the hard drive to my laptop, which has postgres 8.0 installed and running.  My next step was to open the databases from the copied data and export them to scripts so that I can just run them later on the reformatted pc.

However, postgreSQL seems to have a rather unique way of laying out their tablespace data... so I'm having a difficult time figuring out how to open the databases...  I've tried copying the contents of the data folder to a newly created tablespace folder, I've tried overwriting my installation's data folder and even tried switching the postgres installation entirely all to no avail....

At the moment I am going to install postgreSQL 8.0 beta on another PC and try the same list of procedures... however, if there is any other way I can do it easily, I would greatly appreciate the help... especially since I am not certain if my current attempt will work at all...

If you need me to clarify on anything in particular let me know... Thanks in advance for all your help!
0
Phil_Crusader
Asked:
Phil_Crusader
  • 3
  • 2
  • 2
  • +1
1 Solution
 
earth man2Commented:
There seems to be nothing wrong with your approach.  What exact error do you encounter, when you open the database ?  Have you got the postgresql service started ?
0
 
Phil_CrusaderAuthor Commented:
yup the service starts ok, of course I had to stop it first then start it up again right after moving the files...

The error I get is concerning the port that I'm using ... its saying its not enabled or something but the pg_hba.conf file is properly configured...  quite weird...
0
 
earth man2Commented:
Look in your postgresql.conf file for :-

listen_addresses = 'localhost,192.168.127.8'    # what IP interface(s) to listen on;
                                # defaults to localhost, '*' = any
port = 5432

Make sure your ip addresses match the pc and port 5432 is not being blocked by your firewall !
0
Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

 
Phil_CrusaderAuthor Commented:
earthman2 thanks for all your input, yes my postgres.conf file settings where correct and not blocked by firewall...

In anycase, I ended up just installing postgres8.0-beta1 on a different pc then copying the data folder completely to the newly installed database cluster... that seemed to work and I was able to extract my data....
0
 
gheistCommented:
pg_dumpall  > data.sql
psql -f data.sql

for normal UNIX you can pipe over network without having to waste space with dump file
0
 
gheistCommented:
My answer is official way to keep data on significant server upgrades.
0
 
Phil_CrusaderAuthor Commented:
gheist,

Thanks very much for your input and comments, however, that method would not work in this described case since it requires that the PostgreSQL server to be running on the machine in question, as described above, I was attempting to import the databases from another hard drive, whose OS cannot start on its own and thus only had access to the raw data files which I first needed to import before I could dump the actual database information...
0
 
PashaModCommented:
Closed, 125 points refunded.
PashaMod
Community Support Moderator
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now