On 23/12/2020 11:03, Ken Johnson wrote:
Hello,

I am facing the sqlite to postgres or mariadb (mysql) migration of the
Bacula database.  The current db file is about 5GB, after a vacuum.  Right
now I think I will choose the one with the best migration tools I can get
for it.  Otherwise, I do not know of a reason to care.  I have done more
admin on mariadb, I have done more coding (not that much) using postgres.
On the server in question; both postgres and mariadb are already installed.

I am aware of the two scripts from 2006 in examples/database/ in the source
distribution.

I have just under 50 media in the database, with 10 stored offsite; bscan is
not a usable option for me.


Here is my question:  when I think the conversion is complete, what is the
best reasonable method to confirm the success of the conversion?

I would suggest moving to PostgreSQL rather than MariaDB.

PostgreSQL is fully supported by Bacula, MariaDB has thrown up a few nasties where is is not quite the same as MySQL, and those will probably increase.

Also, SQLite3 takes it cues from PostgreSQL, there may be less massaging of data needed to get it right.

I moved from MySQL to PostgreSQL a few years ago, after looking at the various scripts out there I decided I would just do it my way.

First, I set up an empty schema on PostgreSQL using the Bacula installation script "create_postgresql_database".

Then I took a dump of the Bacula data and wrote a script to remove the various "CREATE" statements from it.

I then fed that to psql, looked at the errors, and wrote sed, shell, and SQL scripts to munge things until it was swallowed without any errors.

It took a few iterations to get it right - it was a background task, no rush to move - but once it worked, I dropped and re-created the PostgreSQL database, took a new dump, fed it in, pointed Bacula at PostgreSQL, ran a few commands that use the database - list media, status dir, update volume, frex - manually ran a backup and a restore, then let Bacula just do its thing.

It's worked fine ever since.  :-)

        Cheers,
                Gary    B-)


_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to