Home > Archive > PostgreSQL Discussion > April 2006 > PostgreSQL (file based) database restore









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author PostgreSQL (file based) database restore
Bit Byter

2006-04-07, 8:25 pm

I just did a file based database backup (stopped postmaster and
zipped/copied all files under /usr/local/pgsql/data/* to a differnt
location)

How can I 'restore' the database and start using it?

Leonel Nunez

2006-04-08, 11:26 am

Bit Byter wrote:
> I just did a file based database backup (stopped postmaster and
> zipped/copied all files under /usr/local/pgsql/data/* to a differnt
> location)
>
> How can I 'restore' the database and start using it?
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq
>
>
>



stop the "other" postmaster

then Unzip it

then start the postmaster with the PGDATA pointed to the location of
your files


leonel


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Joshua D. Drake

2006-04-08, 1:25 pm

Bit Byter wrote:
> I just did a file based database backup (stopped postmaster and
> zipped/copied all files under /usr/local/pgsql/data/* to a differnt
> location)
>
> How can I 'restore' the database and start using it?


Assuming you are using linux/unix you can use pg_ctl (read the docs) to
start the new database using the copy structure.

There are a couple of assumptions that I am making for you:

1. You actually copied/archived the files correctly.

2. You have insured that the permissions are correct for the user that
will be calling pg_ctl.

3. You didn't make the backups while the database was running.

Lastly... don't do this. Use pg_dump/pg_restore.

Sincerely,

Joshua D. Drake


--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/



---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com