PDA

View Full Version : Postgres restore question



Cusem
11-26-2008, 06:14 PM
I'm visiting a pokerfriend for a couple of days and I'm gonna use his laptop instead of bringing my desktop.

We both have PostreSQL 8.3

I made a backup at home from my database using the Backup option in PGAdminIII (pgdump.exe) and brought it on a USB stick.

I restored the DB.BACKUP file on my friends laptop using the restore option in PGAdminIII and it finally finished after 4 hours. I however don't see the restored DB in PGAdminIII or in DBControlpanel.exe

I did some googeling on this and found something that if the DB already exists, it gets restored but if the DB is not present a script is created to rebuild the restored DB. I don't know how to do this however.

Can anybody help me with this?

fabio
11-26-2008, 10:36 PM
Have you created a blank database with pgadmin and restore your database to that blank db?

Cusem
11-27-2008, 12:06 AM
No, I just learned I had to do this.

I can't figure out to what DB the data is restored. There are 3 other DB's that show up in DBControlpanel.exe. In PGAdminIII 4 DB's show up ("postgres" DB is the one that doesn't show up in DBControlpanel.exe). I tried figuring out to which one of these the restore was performed by making a backup of all 4 DB's and looking for a bigger/similar filesize of the newly backed up file and the backup file from which was restored, but the first 3 DB's backup in a few seconds and the postgres DB gives a 1,77Gb backup file and the original backup file which I restored is 3,5Gb.

So at this moment I'd like to
1 - use the already restored data, but I don't know where the data is stored or how to create a DB with the already restored data.
2 - Create a database and restore to that DB (The way it had to be done). I however don't know how to regain the disk space used by the previous restore and my friends laptop HD doesn't have enough free space to perform another restore (6,5Gb Free Space)

fabio
11-27-2008, 12:39 PM
You need to delete the previously restored database or another one in order to have enough space

Cusem
11-27-2008, 02:26 PM
I fixed it by backing up his databases (weren't that big) and uninstalling/deleting all of PostgreSQL.

Reinstall and created all DB's again with DBControlpanel.exe. After that I restored all DB's with PGAdminIII.

All went well, except the exit code from the restore processes = 1 and there were some errors. All hands are present however.

Thanks for help!