Bacula-users

Re: [Bacula-users] Migrating form mysql to postgresql: Loading the database takes very long

2011-06-22 00:18:07
Subject: Re: [Bacula-users] Migrating form mysql to postgresql: Loading the database takes very long
From: Stuart McGraw <smcg4191 AT frii DOT com>
To: bacula-users AT lists.sourceforge DOT net
Date: Tue, 21 Jun 2011 22:14:59 -0600
On 06/21/2011 08:06 PM, Dan Langille wrote:
> 
> On Jun 21, 2011, at 3:59 AM, Marcus Mülbüsch wrote:
> 
>> I want to migrate my bacula installation from mysql to postgresql, 
>> following the guide in 
>> http://www.bacula.org/5.0.x-manuals/en/main/main/Installing_Configuring_Post.html#SECTION004450000000000000000
>> 
>> After dumping and converting the database the sql-file now has 9GiB.
>> 
>> I began loading the db into postgres about 18 hours before, but the 
>> process is not yet finished. Is this normal? Or did I miss an important 
>> step?
>> 
>> And the command to load the database is indeed:
>> 
>> "psql -Ubacula bacula < bacula-backup.sql"
>> 
>> and not the mangled version given on the linked page?
> 
> 

> My guess: the output is a series of insert statements, each of which is run 
> in its own transaction.
> 
> Someone else might be able to help more.

The other thing that can be problematic when loading large
amounts of data are indexes on the tables.  Common practice
is to drop indexes (and foreign key constraints but I don't
think Bacula uses any) before loading, and recreating them 
after.  

You can identify the indexes from the CREATE INDEX commands
in /usr/libexec/bacula/make_postgresql_tables.  Drop them 
prior to loading, and then rerun the CREATE INDEX commands
after loading -- it can make a big difference in loading 
time.

HTH



------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users