Yes please on the explanation.
When I use mysqldump –hex-blob , the RestoreObject field/column has the null 
byte equivalents (i.e. it starts with 0x3C0042004100 which is “<BA” ) which I 
haven’t figured out how to decode.

I am only backing up Windows clients, which is why I need the table.  For my 
particular situation I have migrated to Postgres with an empty RestoreObject 
table and have decided to retain the mysql database for a few months.  If I 
need to perform a restore from before the migration I will switch back to the 
mysql backend just for the restore.

- Michel

From: Wanderlei Huttel [mailto:wanderleihut...@gmail.com]
Sent: Thursday, November 30, 2017 8:14 AM
To: Radosław Korzeniewski
Cc: Martin Simmons; bacula-users
Subject: Re: [Bacula-users] Errors migrating from mysql to postgres

Hello Radoslaw

Could you explain better about "mysqldump --hex-blob"?

Maybe I could include in the script and improve for not happen any errors.

Best regards

Wanderlei Hüttel
http://www.huttel.com.br

2017-11-30 9:10 GMT-02:00 Radosław Korzeniewski 
<rados...@korzeniewski.net<mailto:rados...@korzeniewski.net>>:
Hello,

2017-11-28 11:55 GMT+01:00 Wanderlei Huttel 
<wanderleihut...@gmail.com<mailto:wanderleihut...@gmail.com>>:
Hello Michel

I've created some scripts to do this job.
https://github.com/wanderleihuttel/bacula-utils/tree/master/convert_mysql_to_postgresql

I only had some troubles with the Log table, but I've changed some registries 
manually and everything worked fine.
A guy in Brazil with a database with 6gb used these scripts and had no problems

I have migrated a Bacula 5.x to 7.x from MySQL into a PostgreSQL and I had the 
same problem with RestoreObjects table. The solution was to use: --hex-blob 
parameter to mysqldump and use a decode() function from PostgreSQL.
The Restore Objects table is populated when Bacula run a Windows VSS backup. If 
you backup all but Windows VSS you will have no problem with above script. :)

The next problem I encountered was an ' character in some filenames which 
mysqldump is unable to proper escape, even with --compatible=postgresql option. 
So I had to escape it manually (with an additional script).

Finally the migration was successful but due to above errors it took more time 
then expected.

best regards
--
Radosław Korzeniewski
rados...@korzeniewski.net<mailto:rados...@korzeniewski.net>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to