Backup / export DB

Started by Alain Rogerover 19 years ago3 messagesgeneral
Jump to latest
#1Alain Roger
raf.news@gmail.com

Hi,

I have a database (table, stored procedures, accounts,..) on 1 computer.
for some reason i need to move this database to another computer but not in
the same folder name or on the same HDD.

how can i export (and after import) all relative structure and data ?
or maybe a backup of DB is enough ?

thanks a lot,

Alain

#2Noname
Matthias.Pitzl@izb.de
In reply to: Alain Roger (#1)
Re: Backup / export DB

Simply dump the database with pg_dump, copy the dump to the other machine
and restore the dump there.
See the man pages of pg_dump how to use the tool. If you're database
contains foreign keys or similar, make sure to include OIDs into the
database dump.

-- Matthias

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of Alain Roger
Sent: Friday, September 22, 2006 7:59 AM
To: pgsql-general@postgresql.org
Subject: [GENERAL] Backup / export DB

Hi,

I have a database (table, stored procedures, accounts,..) on 1 computer.
for some reason i need to move this database to another computer but not in
the same folder name or on the same HDD.

how can i export (and after import) all relative structure and data ?
or maybe a backup of DB is enough ?

thanks a lot,

Alain

#3Vick Khera
vivek@khera.org
In reply to: Noname (#2)
Re: Backup / export DB

On Sep 22, 2006, at 3:04 AM, Matthias.Pitzl@izb.de wrote:

If you're database contains foreign keys or similar, make sure to
include OIDs into the database dump.

on what basis did you make up this advice?

i have no OID's anywhere and FK's work just fine.

when you set up the new server, be sure to re-create any users you
had on the old, and do the dump as the postgres superuser to ensure
everything gets copied. do the restore as the superuser too to
ensure all ownerships and permissions were as before as well.

Attachments:

smime.p7sapplication/pkcs7-signature; name=smime.p7sDownload