Dump and Restore

Started by Eduardo S. Fontanettiover 21 years ago8 messagesgeneral
Jump to latest
#1Eduardo S. Fontanetti
dufuzzy@yahoo.com.br

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/

#2Secrétariat
ets@rolland-fr.com
In reply to: Eduardo S. Fontanetti (#1)
Re: Dump and Restore

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

Show quoted text

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

#3Paul Thomas
paul@tmsl.demon.co.uk
In reply to: Eduardo S. Fontanetti (#1)
Re: [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   |
+------------------------------+---------------------------------------------+
#4Thilina Gunasekara
tgunasekara@openworld.org
In reply to: Paul Thomas (#3)
Re: [GENERAL] Dump and Restore

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

#5Ron St-Pierre
rstpierre@syscor.com
In reply to: Eduardo S. Fontanetti (#1)
Re: Dump and Restore

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

#6Eduardo S. Fontanetti
dufuzzy@yahoo.com.br
In reply to: Paul Thomas (#3)
Re: [GENERAL] Dump and Restore

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/

#7Oliver Elphick
olly@lfix.co.uk
In reply to: Eduardo S. Fontanetti (#6)
Re: [GENERAL] Dump and Restore

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

#8Lawrence C
research_2004@yahoo.com
In reply to: Oliver Elphick (#7)
Re: [GENERAL] Dump and Restore

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