<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15">
<style type="text/css" style="display:none"><!--P{margin-top:0;margin-bottom:0;} p
        {margin-top:0;
        margin-bottom:0}--></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi Pavol,<br>
Thanks for the useful tip. Exporting all objects made my migration to MariaDB quite easy. Here are some things what I noticed and what may be useful to other users:<br>
</p>
<ul>
<li>When creating initial database structure I selected wrong sql file because of the information
<a href="https://wiki.evolveum.com/display/midPoint/MySQL">here</a>. File midpoint-3.4/config/sql/midpoint/3.4/mysql/mysql-3.4.sql does not contain all objects and had to use midpoint-3.4/config/sql/_all/mysql-3.4-all.sql. I think the MySQL wiki page needs
 to be corrected.</li><li>When importing I accidently checked too many import options ("Keep OID", "Overwrite existing object", "Referential integrity", "Validate dynamic schema", "Validate static schema") but seems that at last some of these options cause problems in import. I
 think its because when importing objects from file some imported objects may refer to objects which have not yet imported. So I checked only 2 options in import dialog - "Keep OID" and "Overwrite existing object".</li><li>I did not succeed to set up database connection with MariaDB connector. (Is this connector supported yet with midPoint?) So I had to use MySQL connector.</li><li>After migration I saw in my midPoint log file following error messages: <span style="color: rgb(255, 0, 0);">
Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost.</span> For me the problem was solved when I changed database global setting wait_timeout from 90 to 3600.<br>
</li></ul>
<p><br>
</p>
<p>Regards,</p>
<p>Aivo<br>
</p>
<div style="color: rgb(33, 33, 33);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" color="#000000" face="Calibri, sans-serif"><b>Saatja:</b> midPoint <midpoint-bounces@lists.evolveum.com> nimelPavol Mederly <mederly@evolveum.com><br>
<b>Saadetud:</b> 4. august 2016 10:28<br>
<b>Adressaat:</b> midpoint@lists.evolveum.com<br>
<b>Teema:</b> Re: [midPoint] Migrating to another database</font>
<div> </div>
</div>
<div>I'm sorry I have to clarify myself: I meant exporting via midPoint, i.e. "Export all objects" in Configuration -> Repository objects.<br>
You can then inspect generated XML and do any fixes you need manually (if needed).<br>
<br>
Before importing, I'd delete automatically generated connector objects from MariaDB, so the only ones left would be imported ones.<br>
<br>
Best regards,<br>
Pavol<br>
<br>
On 04.08.2016 9:11, Pavol Mederly wrote:<br>
<blockquote type="cite">
<p>Hello Aivo,</p>
<p><br>
</p>
<p>one of possible ways is to export all objects from H2 and re-import them to MariaDB.
<br>
</p>
<p>Beware of encrypted data compatibility - it's probably good idea to copy midPoint keystore before first start of midPoint in MariaDB.<br>
</p>
<p><br>
</p>
<p>Best regards,<br>
</p>
<pre class="moz-signature" cols="72">Pavol Mederly
Software developer
evolveum.com
</pre>
<div class="moz-cite-prefix">On 04.08.2016 9:08, Aivo Kuhlberg wrote:<br>
</div>
<blockquote type="cite"><style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<p>I have so far used midPonit with embedded H2 database but now plan to move to MariaDB. I can set up my test environment again from scratch but it would be much easier to migrate existing data to another database. Is there a (not too complicated) way to migrate
 current midPoint data to another database?<br>
</p>
<p><br>
</p>
<p>Thanks,<br>
Aivo Kuhlberg<br>
</p>
<br>
<hr>
<font color="Gray" size="2" face="Arial">Käesolev e-kiri võib sisaldada asutusesiseseks kasutamiseks tunnistatud teavet.<br>
This e-mail may contain information which is classified for official use.</font> <br>
<fieldset class="mimeAttachmentHeader"></fieldset> <br>
<pre>_______________________________________________
midPoint mailing list
<a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>
<a class="moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
</blockquote>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset> <br>
<pre>_______________________________________________
midPoint mailing list
<a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>
<a class="moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
</blockquote>
<br>
</div>
</div>
<br>
<hr>
<font face="Arial" color="Gray" size="2">Käesolev e-kiri võib sisaldada asutusesiseseks kasutamiseks tunnistatud teavet.<br>
This e-mail may contain information which is classified for official use.</font>
</body>
</html>