Copied database to new computer but can't access database

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

Copied database to new computer but can't access database

Postby aleonn » Sun Oct 12, 2008 8:12 am

Before my old HD crashed, I copied my entire 50GB Postgres directory to my new computer. However, after reinstalling PT3 Beta 18 with Postgres, I cannot access the old database files.

It seems that I'm unable to access the "Browse databases" feature, nor am I able to "Edit" the database under Database Management.

Before I purchase the PT3 software, I'd like to make sure my database information is intact and accessible. Thanks in advance for your help!
aleonn
 
Posts: 8
Joined: Sun Oct 12, 2008 7:29 am

Re: Copied database to new computer but can't access database

Postby WhiteRider » Sun Oct 12, 2008 8:31 am

You can't just copy the files across; it should be possible to re-connect to your database, though.
It sounds like you can't run your old computer, still? If you can, you could backup on there and then restore on the new one.

If not, I think you may need to re-install postgres and connect it to the existing DB as you do that, but I'll get someone who knows more about postgres to take a look at this thread and help you.
WhiteRider
Moderator
 
Posts: 54018
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Copied database to new computer but can't access database

Postby kraada » Sun Oct 12, 2008 8:58 am

Was the PostgreSQL server shut down at the time you copied the data over?

If the PostgreSQL server was running while you made the copy the data may be inconsistent; you would need the pg_xlog and pg_clog directories to have been copied also in order for PostgreSQL to be able to recover the database to a working state.

This is in addition to making sure that the files have the proper permissions set . . .

For more information, see this bit of PostgreSQL documentation.

Is the old hard drive in question completely and totally hosed? If you can get it to read one more time and take a normal backup (as explained in the FAQ) it would certainly be the easiest scenario. (You also don't lose much other than time by trying, as if the drive is totally dead it's just not going to work . . .)

I'll do some more digging to see if I can find any better ideas, though.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Copied database to new computer but can't access database

Postby aleonn » Sun Oct 12, 2008 6:57 pm

Looks like I got myself into a big mess :)

Unfortunately I can't access the old HD. I wish I did the normal backup. I do think I copied the files after stopping the Postgres server, though, so hopefully not all is lost.
aleonn
 
Posts: 8
Joined: Sun Oct 12, 2008 7:29 am

Re: Copied database to new computer but can't access database

Postby aleonn » Sat Oct 18, 2008 5:25 am

Just wondering if you had any other ideas on this problem.
aleonn
 
Posts: 8
Joined: Sun Oct 12, 2008 7:29 am

Re: Copied database to new computer but can't access database

Postby WhiteRider » Sat Oct 18, 2008 8:29 am

Try this:

1.) Save your "data" folder. You can find it in C:\Program Files\PostgreSQL\8.3.
2.) Uninstall postgresql completely and delete everything under C:\Program Files\PostgreSQL\8.3. EXCEPT the data folder.
3.) Install PostgreSQL again, but untick "Initialize Database cluster".
4.) click on "connect" again and it should work

This was just posted in another thread yesterday.
viewtopic.php?f=17&t=13427#p62719
WhiteRider
Moderator
 
Posts: 54018
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK


Return to PostgreSQL [Read Only]

Who is online

Users browsing this forum: No registered users and 31 guests

cron
highfalutin