Bacula-users

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

2011-06-27 08:24:05
Subject: Re: [Bacula-users] Migrating form mysql to postgresql: Loading the database takes very long
From: Gavin McCullagh <gavin.mccullagh AT gcd DOT ie>
To: bacula-users AT lists.sourceforge DOT net
Date: Mon, 27 Jun 2011 13:21:01 +0100
On Sat, 25 Jun 2011, Gavin McCullagh wrote:

> It seems you need to drop --quick which is implied in --skip-opt.  The
> resulting command that I'm working with at the moment is:
> 
> mysqldump -t -n -c --compatible=postgresql --skip-quote-names --quick \
>       --lock-tables --add-drop-table --add-locks --create-options 
> --disable-keys \
>       --extended-insert --set-charset  -u bacula -ppassword bacula \
>       | grep -v "INSERT INTO Status"    \
>       | sed -e 's/0000-00-00 00:00:00/1970-01-01 00:00:00/g' \
>       | sed -e 's/\\0//' > bacula-backup.sql`

I should clarify this slightly.  I needed to remove --skip-opt which
implies --skip-quick and add --quick:

  This option is useful for dumping large tables. It forces mysqldump to
  retrieve rows for a table from the server a row at a time rather than
  retrieving the entire row set and buffering it in memory before writing
  it out.

--opt (which is on by default) sets all of:

        --add-drop-table --add-locks --create-options --disable-keys
        --extended-insert --lock-tables --quick --set-charset

--skip-opt disables --opt, so presumably it negates the above.  My command
above doesn't go quite that far.  Things like table locking shouldn't
be necessary if the bacula director is actually stopped at the time.

Gavin


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users