syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Syncope > Deal with internal storage export - import?
Date Fri, 26 Apr 2013 14:30:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/9/3/_/styles/combined.css?spaceKey=SYNCOPE&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=31819687">Deal
with internal storage export - import?</a></h2>
    <h4>Page  <b>added</b> by             <a href="https://cwiki.apache.org/confluence/display/~ilgrosso">Francesco
Chicchiricco</a>
    </h4>
         <br/>
    <div class="notificationGreySide">
         <style type='text/css'>/*<![CDATA[*/
div.rbtoc1366986542782 {margin-left: 1.5em;padding: 0px;}
div.rbtoc1366986542782 ul {list-style: decimal;margin-left: 0px;}
div.rbtoc1366986542782 li {margin-left: 0px;padding-left: 0px;}

/*]]>*/</style><div class='rbtoc1366986542782'>
<ul>
    <li><a href='#Dealwithinternalstorageexport-import%3F-Introduction'>Introduction</a></li>
    <li><a href='#Dealwithinternalstorageexport-import%3F-Export'>Export</a></li>
    <li><a href='#Dealwithinternalstorageexport-import%3F-Import'>Import</a></li>
<ul>
    <li><a href='#Dealwithinternalstorageexport-import%3F-Gotchas'>Gotchas</a></li>
<ul>
    <li><a href='#Dealwithinternalstorageexport-import%3F-Wipeexistingcontent'>Wipe
existing content</a></li>
    <li><a href='#Dealwithinternalstorageexport-import%3F-MySQLandlowercasetablenames'>MySQL
and lower case table names</a></li>
    <li><a href='#Dealwithinternalstorageexport-import%3F-OpenJPAsequences'>OpenJPA
sequences</a></li>
</ul>
</ul>
</ul></div>

<h1><a name="Dealwithinternalstorageexport-import%3F-Introduction"></a>Introduction</h1>

<p>Almost every configurable aspect of a running Apache Syncope instance is contained
into the internal storage: attribute schemas, connectors, resources, mapping, roles, synchronization
tasks and other parameters.</p>

<p>During implementation of an Apache Syncope-based project, it might be handful to
move such configuration back and forth from one Apache Syncope instance to another (say developer's
laptop and production server).</p>

<p>An option is clearly acting at low level by empowering DBMS' dump &amp; restore
capabilities, but what if poor developer is running MySQL (or even in-memory H2) while sysadmin
features Oracle?</p>

<h1><a name="Dealwithinternalstorageexport-import%3F-Export"></a>Export</h1>

<p>Click on the Configuration icon at top, then to the rightmost icon on the tab row:
you will be prompted for downloading a file named <tt>content.xml</tt>.</p>

<p><span class="error">Unable to render embedded object: File (export.png) not
found.</span></p>

<p>You can also get this file <a href="/confluence/display/SYNCOPE/Calling+RESTful+services+from+CLI#CallingRESTfulservicesfromCLI-Exportdatabasecontent">via
CLI</a>.</p>

<h1><a name="Dealwithinternalstorageexport-import%3F-Import"></a>Import</h1>

<p>Basically, all you need to do is replace local <tt>content.xml</tt> with
the one exported as explained above; but where is this <tt>content.xml</tt> located
at?</p>
<ul>
	<li><tt>core/src/test/resources/content.xml</tt> for <a href="/confluence/display/SYNCOPE/Run+Syncope+in+embedded+mode"
title="Run Syncope in embedded mode">embedded mode</a></li>
	<li><tt>core/src/main/resources/content.xml</tt> for <a href="/confluence/display/SYNCOPE/Run+Syncope+in+real+environments"
title="Run Syncope in real environments">real environments</a></li>
	<li><tt>webapps/syncope/WEB-INF/classes/content.xml</tt> from the Apache
Tomcat directory, for <a href="/confluence/display/SYNCOPE/Run+Syncope+standalone+distribution"
title="Run Syncope standalone distribution">standalone distribution</a></li>
</ul>


<h2><a name="Dealwithinternalstorageexport-import%3F-Gotchas"></a>Gotchas</h2>

<h3><a name="Dealwithinternalstorageexport-import%3F-Wipeexistingcontent"></a>Wipe
existing content</h3>
<p>When not running in-memory H2, internal storage's content must be wiped before starting
Apache Syncope, otherwise <tt>content.xml</tt> will be just ignored.</p>

<p>Check <tt>core-persistence.log</tt> for message</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
Empty database found, loading <span class="code-keyword">default</span> content
</pre>
</div></div>
<p>If the internal storage is not empty, instead, you will get</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
Data found in the database, leaving untouched
</pre>
</div></div>

<h3><a name="Dealwithinternalstorageexport-import%3F-MySQLandlowercasetablenames"></a>MySQL
and lower case table names</h3>

<p>On some platforms (namely, Mac OS X) MySQL is configured by default to be case insensitive:
in such cases, you might want to edit <tt>/etc/my.cnf</tt> file and add the following
line into <tt>[mysqld]</tt>:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
lower_case_table_names=1
</pre>
</div></div>

<h3><a name="Dealwithinternalstorageexport-import%3F-OpenJPAsequences"></a>OpenJPA
sequences</h3>

<p>In exported <tt>content.xml</tt> you might find some elements like as</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
&lt;OPENJPA_SEQUENCES_TABLE ID=<span class="code-quote">"SEQ_ConnInstance"</span>
SEQUENCE_VALUE=<span class="code-quote">"1100"</span>/&gt;
</pre>
</div></div>

<p>Since most tables in the internal storage feature OpenJPA's sequence id generation,
this means that new rows in the <tt>ConnInstance</tt> table will get ids from
1100 upwards.</p>
    </div>
    <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
       </div>
       <a href="https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=31819687">View
Online</a>
              |
       <a href="https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=31819687&showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
           </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message