502,507c502,547
< ... Several users have done so by first producing an ASCII "dump" of the
< SQLite database, then creating the MySQL tables with the <b>create_mysql_tables</b> script that comes with Bacula, and finally feeding the
< SQLite dump into MySQL using the <b>-f</b> command line option to continue past
< the errors that are generated by the DDL statements that SQLite's dump
< creates. Of course, you could edit the dump and remove the offending
< statements. Otherwise, MySQL accepts the SQL produced by SQLite. 
---
> ... Several users have done so by the following proceduer:
> <br/>
> <br/>
> &nbsp <strong>1.)</strong> First Use the <strong>create_mysql_tables</strong> script distributed with bacula to create the MySQL database, and tables. <br/>
> &nbsp <strong>2.)</strong> Next, produce an ASCII "dump" of the SQLite database using the following: <br/>
> <blockquote>
> <strong>echo ".dump" | /usr/bin/sqlite bacula.db > bacula-sqlite.sql </strong><br/>
> </blockquote>
> &nbsp <strong>3.)</strong> SQLite will produce some SQL that MySQL will not interpret correctly. The following
> <a href=/path/to/script/bacula-sqlite_2_mysqldump.sh>script</a> will fix most
> of these issues, but it might need to be modified slightly for use with other versions of bacula: <br/>
>  <br/>&#60code&#62<blockquote>
> #! /bin/sh <br/>
> # <br/>
> # bacula-sqlite_2_mysqldump.sh <br/>
> # <br/>
> # Convert a Bacula 1.36.2 Sqlite database to MySQL <br/>
> # Originally Written by Nic Bellamy <nic@bellamy.co.nz>, Sept/Oct 2003. <br/>
> # Modified by Silas Bennett <silas.bennett_AT_ge.com>, April 2006 for use with Bacula 1.36.2 <br/>
> # <br/>
> <br/>
> if [ $1 == '-h' ] || [ $1 == '--help' ] ; then <br/>
> &nbsp&nbsp&nbsp&nbsp echo `basename "$0"`" Usage:" <br/>
> &nbsp&nbsp&nbsp&nbsp echo " "`basename $0`" takes a ASCII bacula sqlite database dump as an argument," <br/>
> &nbsp&nbsp&nbsp&nbsp echo " and writes an SQL dump suitable for use with MySQL to STDOUT." <br/>
> &nbsp&nbsp&nbsp&nbsp echo <br/>
> &nbsp&nbsp&nbsp&nbsp echo " Example Use: "`basename $0`" bacula.sqlite.sql > bacula.mysql.sql" <br/>
> &nbsp&nbsp&nbsp&nbsp echo " Example Use: "cat bacula.sqlite.sql | `basename $0`" - | mysql -p -u <user> baculadb" <br/>
> &nbsp&nbsp&nbsp&nbsp exit <br/>
> fi <br/>
> <br/><br/>
> # If $1 is '-' then cat will read /dev/stdin <br/>
> cat $1 | <br/>
> awk '/^INSERT INTO / && $3 != "NextId" && $3 != "Version" { print $0 }' | <br/>
> sed '/^INSERT INTO [a-zA-Z]* VALUES(/s/(NULL)/(0)/g ; /^INSERT INTO [a-zA-Z]* VALUES(/s/(NULL,/(0,/g ; /^INSERT INTO [a-zA-Z]* VALUES(/s/,NULL,/,0,/g ; /^INSERT INTO [a-zA-Z]* VALUES(/s/,NULL,/,0,/g ; /^INSERT INTO [a-zA-Z]* VALUES(/s/,NULL)/,0)/g' <br/>
> </blockquote>&#60/code&#62<br/><br/>
> &nbsp <strong>4.)</strong> Next feed the SQL dump to MySQL: <br/>
> <blockquote>
> <strong>mysql -p -u root baculadb < bacula.mysql.sql <br/></strong>
> </blockquote>
> Note you could do steps 2-4 in one shot using pipes. But if you are not using bacula 1.36.2 it would be a good idea to do this in steps storing each step to file.
> The reason for this is that if your database is large the dumps, and conversions will take quite a while, and if you need to make modifications to the conversion script
> then not having to do the sqlite dump repeatedly is conveniant. If you would like to do it all in one shot use the following oneliner:<br/>
> <blockquote>
> <strong>echo ".dump" | /usr/bin/sqlite bacula.db | bacula-sqlite_2_mysqldump.sh - | mysql -p -u <user> baculadb <br/></strong>
> </blockquote>
550c590
< </p></li><li>You use <b>RunBeforeJob</b> to create the ASCII  backup file and <b>   RunAfterJob</b> to clean up 
---
> </p></li><li>You use <b>RunBeforeJob</b> to create the ASCII  backup file and <b>   RunAfterJob</b> to clean up
