dumping and restoring user information.
dumping and restoring user information.
От:
Pritesh Shah <pritesh.krish@gmail.com>
Дата:
hi, I'm trying to make some hardware upgrades (increasing disk capacity) to the machine where the database server is running. So, I've backed up all the existing databases using the following command: pg_dump -f -Fc -v I want to restore these databases on a different machine. I've got the postmaster installed and running (version same as on old one). To restore the databases i tried the following command: pg_restore -v -d to which i got the following error: pg_restore: connecting to database for restore pg_restore: [archiver (db)] connection to database "abc" failed: FATAL: datab ase "abc" does not exist pg_restore: *** aborted because of error Realizing my mistake i used the following command: pg_restore -v -C -d template1 to which i got the following error: pg_restore: connecting to database for restore pg_restore: creating DATABASE abc pg_restore: [archiver] could not set session user to "abc": ERROR: user "abc" does not exist pg_restore: *** aborted because of error So, seeing this i first made the user, using 'createuser' and then created a database using 'createdb'. Now, since i have many users do i have to everytime createuser and createdb for each user and database. Is there any way of copying/dumping/restoring the user and group information and permissions from the old machine to the new one so that i do not have to do a createuser everytime?? Could somebody help me out with this please. Thanks in advance. Cheers, Pritesh
Re: dumping and restoring user information.
От:
Michael Fuhr <mike@fuhr.org>
Дата:
On Tue, Feb 01, 2005 at 12:11:06AM -0700, Pritesh Shah wrote: > > Is there any way of copying/dumping/restoring the user and group > information and permissions from the old machine to the new one so > that i do not have to do a createuser everytime?? You can dump just users and groups with "pg_dumpall --globals-only" (or -g). -- Michael Fuhr http://www.fuhr.org/~mfuhr/
Re: dumping and restoring user information.
От:
Pritesh Shah <pritesh.krish@gmail.com>
Дата:
Thanks, it worked. On Tue, 1 Feb 2005 00:30:31 -0700, Michael Fuhr wrote: > On Tue, Feb 01, 2005 at 12:11:06AM -0700, Pritesh Shah wrote: > > > > Is there any way of copying/dumping/restoring the user and group > > information and permissions from the old machine to the new one so > > that i do not have to do a createuser everytime?? > > You can dump just users and groups with "pg_dumpall --globals-only" > (or -g). > > -- > Michael Fuhr > http://www.fuhr.org/~mfuhr/ >