Database Migration

Dear All,

In preparing to move the two Ciphermail servers (djigzo_3.0.5-0) I am keeping in a dual SOHO situation from Centos 6 to Centos 7, I would also very much like to switch from postgres to mysql. That would allow me to work with a Percona mysql cluster to synchronize the servers instead of continuing with bucardo synchronization or investigate the new built-in and probably better postgres synchronization possibilities.

Based on the install instructions, I was able to setup Ciphermail on Centos 7 with mysql. Running "mysql djigzo < /usr/local/djigzo/conf/database/sql/djigzo.mysql.sql" (in my case modified to run on an external host) does create the usual 29 tables.

What I find myself unable to do is to convert the data (admin, atmin_authority, authority, blob, current certificates, certificates_email, properties, crls, keyring, keyring_email, keyring_userid, keystore, named_blob, pgp_trust_list, pgp_trust_list_namevalues, properties, properties_namevalues, userpreferences, userpreferences_certificates, userpreferences_inheritedpreferences, userpreferences_named_certificates, users) from postgres to mysql. I was naively thinking that ODBC and mysql workbench could do the job in a straightforward manner, but I did not find that feasible. For example, there are lots of "truncated key column length ..." warnings (logfile available upon request) and I did not find the result to work. I must admit that I am far from being a database expert also.

Is it realistic to migrate the database or would one have to start from scratch even in terms of users and certificates?

Regards,

Michael

Unfortunately an easy migration path is currently not available. The
problem is that MySQL has some strict requirements about table names,
length of fields, types etc. It's therefore not as easy as copying the
tables one to one. The most important data is the certificates, keys and
PGP keys. These can be exported from the gateway to a file which can
then be imported into the gateway. A user object is only required if you
override an inherited value so in most cases a user object is not required.

Kind regards,

Martijn Brinkers

···

On 06/03/2016 12:48 AM, Prof. Dr. Michael Schefczyk wrote:

Dear All,

In preparing to move the two Ciphermail servers (djigzo_3.0.5-0) I am
keeping in a dual SOHO situation from Centos 6 to Centos 7, I would
also very much like to switch from postgres to mysql. That would
allow me to work with a Percona mysql cluster to synchronize the
servers instead of continuing with bucardo synchronization or
investigate the new built-in and probably better postgres
synchronization possibilities.

Based on the install instructions, I was able to setup Ciphermail on
Centos 7 with mysql. Running "mysql djigzo <
/usr/local/djigzo/conf/database/sql/djigzo.mysql.sql" (in my case
modified to run on an external host) does create the usual 29
tables.

What I find myself unable to do is to convert the data (admin,
atmin_authority, authority, blob, current certificates,
certificates_email, properties, crls, keyring, keyring_email,
keyring_userid, keystore, named_blob, pgp_trust_list,
pgp_trust_list_namevalues, properties, properties_namevalues,
userpreferences, userpreferences_certificates,
userpreferences_inheritedpreferences,
userpreferences_named_certificates, users) from postgres to mysql. I
was naively thinking that ODBC and mysql workbench could do the job
in a straightforward manner, but I did not find that feasible. For
example, there are lots of "truncated key column length ..." warnings
(logfile available upon request) and I did not find the result to
work. I must admit that I am far from being a database expert also.

Is it realistic to migrate the database or would one have to start
from scratch even in terms of users and certificates?

--
CipherMail email encryption

Email encryption with support for S/MIME, OpenPGP, PDF encryption and
secure webmail pull.

Twitter: http://twitter.com/CipherMail

--
CipherMail email encryption

Email encryption with support for S/MIME, OpenPGP, PDF encryption and
secure webmail pull.

Twitter: http://twitter.com/CipherMail

Dear Martijn,

Thank you for confirming this. I did try all I could in terms of adapting the prefixes and table names in the database I did convert through the mysql workbench. In the end, foreign key constraints and the like did seem unsurmountable to me. I will now try the way of moving the certificates and manually configuring the rest. My database is not that large in terms of number of users and the like, that this would be a major issue.

Regards,

Michael

···

-----Ursprüngliche Nachricht-----
Von: users-bounces(a)lists.djigzo.com [mailto:users-bounces(a)lists.djigzo.com] Im Auftrag von Martijn Brinkers
Gesendet: Freitag, 3. Juni 2016 14:49
An: users(a)lists.djigzo.com
Betreff: Re: Database Migration

On 06/03/2016 12:48 AM, Prof. Dr. Michael Schefczyk wrote:

Dear All,

In preparing to move the two Ciphermail servers (djigzo_3.0.5-0) I am
keeping in a dual SOHO situation from Centos 6 to Centos 7, I would
also very much like to switch from postgres to mysql. That would allow
me to work with a Percona mysql cluster to synchronize the servers
instead of continuing with bucardo synchronization or investigate the
new built-in and probably better postgres synchronization
possibilities.

Based on the install instructions, I was able to setup Ciphermail on
Centos 7 with mysql. Running "mysql djigzo <
/usr/local/djigzo/conf/database/sql/djigzo.mysql.sql" (in my case
modified to run on an external host) does create the usual 29 tables.

What I find myself unable to do is to convert the data (admin,
atmin_authority, authority, blob, current certificates,
certificates_email, properties, crls, keyring, keyring_email,
keyring_userid, keystore, named_blob, pgp_trust_list,
pgp_trust_list_namevalues, properties, properties_namevalues,
userpreferences, userpreferences_certificates,
userpreferences_inheritedpreferences,
userpreferences_named_certificates, users) from postgres to mysql. I
was naively thinking that ODBC and mysql workbench could do the job in
a straightforward manner, but I did not find that feasible. For
example, there are lots of "truncated key column length ..." warnings
(logfile available upon request) and I did not find the result to
work. I must admit that I am far from being a database expert also.

Is it realistic to migrate the database or would one have to start
from scratch even in terms of users and certificates?

Unfortunately an easy migration path is currently not available. The problem is that MySQL has some strict requirements about table names, length of fields, types etc. It's therefore not as easy as copying the tables one to one. The most important data is the certificates, keys and PGP keys. These can be exported from the gateway to a file which can then be imported into the gateway. A user object is only required if you override an inherited value so in most cases a user object is not required.

Kind regards,

Martijn Brinkers

--
CipherMail email encryption

Email encryption with support for S/MIME, OpenPGP, PDF encryption and secure webmail pull.

Twitter: http://twitter.com/CipherMail

--
CipherMail email encryption

Email encryption with support for S/MIME, OpenPGP, PDF encryption and secure webmail pull.

Twitter: http://twitter.com/CipherMail
_______________________________________________
Users mailing list
Users(a)lists.djigzo.com
https://lists.djigzo.com/lists/listinfo/users