[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to restore backup

On Wed, Feb 22, 2012 at 9:11 AM, Steven Marshall <..hidden..> wrote:
I am in the process of moving Ledgersmb 1.3.11 to another server.  On my old server using admin.pl I have backed up my database as well as roles.  How should I restore both database and roles on my new server?  Using pg_restore?

Use psql to restore the roles and pg_restore to restore the database.

Typically this will be something like:

psql -U postgres -f my_roles_file
pg_restore -U postgres -C my_backup_file

Note that this assumes that your database does not exist on the new server.  You should drop it before.

The roles backup only backs up some cluster-wide globals, like roles.  The database it is restored to doesn't matter.

The second creates the database named in the backup, and restores the backup to the database it just created.  This is of course not the only thing you can do with your backup.  See the pg_restore man page for many more details.

Best Wishes,
Chris Travers
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
Ledger-smb-users mailing list