Restoring a backup DB on a new Postgres Server

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

Restoring a backup DB on a new Postgres Server

Postby mtdoak » Wed Apr 02, 2008 11:09 pm

So, I have installed PostGres 8.3 on my mac mini.

I have a my backup on the root of the mac harddrive (the path is /observed.backup)

I have created a new DB using "psql createdb observed", then I tried "psql observed > /observed.backup"

I got nothing but a wall of errors when I tried that.

I tried going into "psql observed" then trying "use /observed.backup", which told me permission was denied.

Whats the proper way to do this?
mtdoak
 
Posts: 6
Joined: Wed Apr 02, 2008 10:59 pm

Re: Restoring a backup DB on a new Postgres Server

Postby APerfect10 » Wed Apr 02, 2008 11:25 pm

It should be "psql observed < /observed.backup".

> dumps the table to file. Hopefully you did not overwrite your backup...

Best regards,

Derek
APerfect10
Site Admin
 
Posts: 4489
Joined: Sat Dec 08, 2007 6:03 pm

Re: Restoring a backup DB on a new Postgres Server

Postby mtdoak » Wed Apr 02, 2008 11:39 pm

sorry, that was a type.

I am getting errors about UTF8, etc. Just a huge page full or errors.

Any ideas?
mtdoak
 
Posts: 6
Joined: Wed Apr 02, 2008 10:59 pm

Re: Restoring a backup DB on a new Postgres Server

Postby mtdoak » Wed Apr 02, 2008 11:43 pm

This might help, I get these errors immed. after running the command:

[code5ly]lso happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".
ERROR: invalid byte sequence for encoding "UTF8": 0xa8
HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".
ERROR: invalid byte sequence for encoding "UTF8": 0x92
HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".
ERROR: invalid byte sequence for encoding "UTF8": 0xb1
HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".
ERROR: invalid byte sequence for encoding "UTF8": 0xac
HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".
[/code5ly]
mtdoak
 
Posts: 6
Joined: Wed Apr 02, 2008 10:59 pm

Re: Restoring a backup DB on a new Postgres Server

Postby APerfect10 » Wed Apr 02, 2008 11:46 pm

Go [codewz3]createdb -E SQL_ASCII observed[/codewz3]

Then try restoring your dump.

-Derek
APerfect10
Site Admin
 
Posts: 4489
Joined: Sat Dec 08, 2007 6:03 pm

Re: Restoring a backup DB on a new Postgres Server

Postby mtdoak » Thu Apr 03, 2008 12:08 am

[quote="APerfect10"pds]Go [codepds]createdb -E SQL_ASCII observed[/codepds]

Then try restoring your dump.

-Derek[/quotepds]

dropped the observed db, recreated with the "createdb -E SQL_ASCII observed"

gave me the same errors.

Just for fun tried it again with "observed2", same thing

?

Possibly a setup issue on the server?
mtdoak
 
Posts: 6
Joined: Wed Apr 02, 2008 10:59 pm

Re: Restoring a backup DB on a new Postgres Server

Postby APerfect10 » Thu Apr 03, 2008 12:32 am

What happens if you create a new database via PT3?

-Derek
APerfect10
Site Admin
 
Posts: 4489
Joined: Sat Dec 08, 2007 6:03 pm

Re: Restoring a backup DB on a new Postgres Server

Postby mtdoak » Thu Apr 03, 2008 12:37 am

[quote="APerfect10"y9r]What happens if you create a new database via PT3?

-Derek[/quotey9r]

I'm not that far along yet. This is a PT2 postgres backup file I'm working with.

Should I setup my postgres server to connect to PT3, create a DB via PT3, then dump the old DB backup into it?

Is there a list of commands that PT uses to make its databases that I can cheat off of?
mtdoak
 
Posts: 6
Joined: Wed Apr 02, 2008 10:59 pm

Re: Restoring a backup DB on a new Postgres Server

Postby APerfect10 » Thu Apr 03, 2008 12:55 am

Ok, if you are using PT2 then try using the PT2 utility...

Utilities->PostgreSQL Database Functions. Under "Restore a Database' click browse and select your dump file.

Best regards,

Derek
APerfect10
Site Admin
 
Posts: 4489
Joined: Sat Dec 08, 2007 6:03 pm

Re: Restoring a backup DB on a new Postgres Server

Postby mtdoak » Thu Apr 03, 2008 10:17 am

[quote="APerfect10"xjj]Ok, if you are using PT2 then try using the PT2 utility...

Utilities->PostgreSQL Database Functions. Under "Restore a Database' click browse and select your dump file.

Best regards,

Derek[/quotexjj]

Not what I am trying to do. I can do that right now. I am setting up a server, i want to move my DBs to a dedicated server.

Any way I can get a copy of the script that Poker Tracker 2 uses to make the databases, so I can make an exact copy of the Database then try a data dump?
mtdoak
 
Posts: 6
Joined: Wed Apr 02, 2008 10:59 pm

Next

Return to PostgreSQL [Read Only]

Who is online

Users browsing this forum: No registered users and 4 guests