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

Re: How to restore backup

On Wed, Feb 22, 2012 at 11:04 PM, Chris Travers <..hidden..> wrote:

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

I restored the roles OK, but getting an error when trying to restore my database.  I tried two different commands but get the same offset error.  See below.

..hidden..:~> pg_restore -C backup_StallusBoutique_Test_2012-02-22.bak
pg_restore: [archiver] unexpected data offset flag 0

..hidden..:~> pg_restore -C -d postgres backup_StallusBoutique_Test_2012-02-22.bak
pg_restore: [archiver] unexpected data offset flag 0

Best Regards,
Steven Marshall

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