Thread: Dump and Restore

Dump and Restore

From
"Eduardo S. Fontanetti"
Date:
How can I do a test if my dumping is really working, I
can't apply the dump in my database, because it will
overwrite a lot of data. I was thinking about restore
in another database name, but I can't, it always
restore on the original database.

Somebody have a cooking recipe about to test if my
backup is working fine, and will help if I need
sometime?

Thanks for all of you!

Eduardo S. Fontanetti





_______________________________________________________
Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade!
http://br.acesso.yahoo.com/

Re: Dump and Restore

From
Secrétariat
Date:
One way is to create another instance of your PG server,
using a different PGDATA path.
So your actual data won't be overwriten.

Luc

> How can I do a test if my dumping is really working, I
> can't apply the dump in my database, because it will
> overwrite a lot of data. I was thinking about restore
> in another database name, but I can't, it always
> restore on the original database.
>
> Somebody have a cooking recipe about to test if my
> backup is working fine, and will help if I need
> sometime?
>
> Thanks for all of you!
>
> Eduardo S. Fontanetti
>
>
>
>
>
> _______________________________________________________
> Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade!
> http://br.acesso.yahoo.com/
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
>                http://archives.postgresql.org
>


Re: Dump and Restore

From
Paul Thomas
Date:
On 24/08/2004 14:40 Eduardo S. Fontanetti wrote:
> How can I do a test if my dumping is really working, I
> can't apply the dump in my database, because it will
> overwrite a lot of data. I was thinking about restore
> in another database name, but I can't, it always
> restore on the original database.
>
> Somebody have a cooking recipe about to test if my
> backup is working fine, and will help if I need
> sometime?

Are you using pg_dump or pg_dumpall? I just use pg_dump on individual
databases (pg_dumpall works on the whole cluster) and can restore that to
any database.


HTH

--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for
Business             |
| Computer Consultants         |
http://www.thomas-micro-systems-ltd.co.uk   |
+------------------------------+---------------------------------------------+

Re: [ADMIN] Dump and Restore

From
"Thilina Gunasekara"
Date:
Assuming you're using Unix Box
1. Dump your database DB_X
pg_dump -v -U postgresUsername DB_X | gzip -f - > DB_X.gz

2.Create database DB_Y
psql -U postgresUsername template1
CREATE DATABASE DB_Y
\q

3. zcat DB_X.gz | psql -U postgresUsername -f - DB_Y

Thilina


-----Original Message-----
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org]On Behalf Of Paul Thomas
Sent: 24 August 2004 16:30
To: Eduardo S . Fontanetti
Cc: pgsql-admin@postgresql.org; pgsql-general@postgresql.org
Subject: Re: [ADMIN] [GENERAL] Dump and Restore



On 24/08/2004 14:40 Eduardo S. Fontanetti wrote:
> How can I do a test if my dumping is really working, I
> can't apply the dump in my database, because it will
> overwrite a lot of data. I was thinking about restore
> in another database name, but I can't, it always
> restore on the original database.
>
> Somebody have a cooking recipe about to test if my
> backup is working fine, and will help if I need
> sometime?

Are you using pg_dump or pg_dumpall? I just use pg_dump on individual
databases (pg_dumpall works on the whole cluster) and can restore that to
any database.


HTH

--
Paul Thomas
+------------------------------+--------------------------------------------
-+
| Thomas Micro Systems Limited | Software Solutions for
Business             |
| Computer Consultants         |
http://www.thomas-micro-systems-ltd.co.uk   |
+------------------------------+--------------------------------------------
-+

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

               http://www.postgresql.org/docs/faqs/FAQ.html


Re: Dump and Restore

From
Ron St-Pierre
Date:
Eduardo S. Fontanetti wrote:

>How can I do a test if my dumping is really working, I
>can't apply the dump in my database, because it will
>overwrite a lot of data. I was thinking about restore
>in another database name, but I can't, it always
>restore on the original database.
>
>Somebody have a cooking recipe about to test if my
>backup is working fine, and will help if I need
>sometime?
>
>
<snip>
OK here's a recipe:
If you're using  pg_dump as in:
    pg_dump dbName > fileName
create your new database:
   createdb myNewDB (don't forget your encoding)
and then restore from the dump:
   psql -d myNewDB -f fileName

Ron


Re: Dump and Restore

From
"Eduardo S. Fontanetti"
Date:
I am using pg_dump.

It means that I can't restore to a different name
database??

Eduardo S. Fontanetti

 --- Paul Thomas <paul@tmsl.demon.co.uk> escreveu:
>
> On 24/08/2004 14:40 Eduardo S. Fontanetti wrote:
> > How can I do a test if my dumping is really
> working, I
> > can't apply the dump in my database, because it
> will
> > overwrite a lot of data. I was thinking about
> restore
> > in another database name, but I can't, it always
> > restore on the original database.
> >
> > Somebody have a cooking recipe about to test if my
> > backup is working fine, and will help if I need
> > sometime?
>
> Are you using pg_dump or pg_dumpall? I just use
> pg_dump on individual
> databases (pg_dumpall works on the whole cluster)
> and can restore that to
> any database.
>
>
> HTH
>
> --
> Paul Thomas
>
+------------------------------+---------------------------------------------+
> | Thomas Micro Systems Limited | Software Solutions
> for
> Business             |
> | Computer Consultants         |
> http://www.thomas-micro-systems-ltd.co.uk   |
>
+------------------------------+---------------------------------------------+
>





_______________________________________________________
Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade!
http://br.acesso.yahoo.com/

Re: Dump and Restore

From
Oliver Elphick
Date:
On Tue, 2004-08-24 at 17:36, Eduardo S. Fontanetti wrote:
> I am using pg_dump.
>
> It means that I can't restore to a different name
> database??

If you use pg_dump[all] without other options it will dump to a text
file.  Just edit the database name.

--
Oliver Elphick                                          olly@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA  92C8 39E7 280E 3631 3F0E  1EC0 5664 7A2F A543 10EA
                 ========================================
     "I saw in the night visions, and, behold, one like the
      Son of man came with the clouds of heaven, and came to
      the Ancient of days, and they brought him near before
      him. And there was given him dominion, and glory, and
      a kingdom, that all people, nations, and languages,
      should serve him; his dominion is an everlasting
      dominion, which shall not pass away, and his kingdom
      that which shall not be destroyed."
                                    Daniel 7:13,14


Re: [ADMIN] Dump and Restore

From
Lawrence C
Date:
You can also
$ cat dumpfile | more


 --- Oliver Elphick <olly@lfix.co.uk> wrote:
> On Tue, 2004-08-24 at 17:36, Eduardo S. Fontanetti
> wrote:
> > I am using pg_dump.
> >
> > It means that I can't restore to a different name
> > database??
>
> If you use pg_dump[all] without other options it
> will dump to a text
> file.  Just edit the database name.
>
> --
> Oliver Elphick
>    olly@lfix.co.uk
> Isle of Wight
> http://www.lfix.co.uk/oliver
> GPG: 1024D/A54310EA  92C8 39E7 280E 3631 3F0E  1EC0
> 5664 7A2F A543 10EA
>
> ========================================
>      "I saw in the night visions, and, behold, one
> like the
>       Son of man came with the clouds of heaven, and
> came to
>       the Ancient of days, and they brought him near
> before
>       him. And there was given him dominion, and
> glory, and
>       a kingdom, that all people, nations, and
> languages,
>       should serve him; his dominion is an
> everlasting
>       dominion, which shall not pass away, and his
> kingdom
>       that which shall not be destroyed."
>                                     Daniel 7:13,14
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping"
your friends today! Download Messenger Now
http://uk.messenger.yahoo.com/download/index.html