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

Re: How to restore backup





On Wed, Feb 22, 2012 at 7:36 PM, Steven Marshall <..hidden..> wrote:


On Thu, Feb 23, 2012 at 1:20 AM, Chris Travers <..hidden..> wrote:


On Wed, Feb 22, 2012 at 7:17 PM, Steven Marshall <..hidden..> wrote:


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

Are the encodings different in the databases?  Different PostgreSQL versions?  Anything else different?

Best Wishes,
Chris Travers 

Not sure about the encodings or how to check. As for the versions, I made my backup from a PostgreSQL server version 9.1.1-3.1.4 and trying to restore to server version 9.0.3-1.6.1

You could try using the pg_restore on the 9.1 system along with -h pointing to the 9.0 server.

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.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Ledger-smb-users mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-users