blob: 6b74268ed144b1e7f8fee67571ddcb8a3ece6539 [file] [log] [blame]
Title: cdataport
<P>Sometimes it is necessary to recreate a database, copying data from another existing database. For instance, recreating development database instance from production data, etc. While most RDBMS provide data import/export tools, they normally require advanced DBA skills to use and are most often not portable across database engines. Cayenne will provide a lightweight ant task to do data porting between the databases with identical schema, using DataMap information.</P>
<P><TT>cdataport</TT> is an Ant task that takes a Cayenne project (cayenne.xml) with at least one DataMap and two DataNodes and ports data from source DataNode to a destination DataNode. All DataMaps linked to either the source or the target DataNode will be considered for porting.</P>
<H5><A name="cdataport-Parameters"></A>Parameters</H5>
<DIV class="table-wrap">
<TABLE class="confluenceTable"><TBODY>
<TR>
<TH class="confluenceTh">Attribute</TH>
<TH class="confluenceTh">Description</TH>
<TH class="confluenceTh">Required</TH>
</TR>
<TR>
<TD class="confluenceTd">projectFile</TD>
<TD class="confluenceTd">Location of Cayenne project file containing mapping.</TD>
<TD class="confluenceTd">Yes</TD>
</TR>
<TR>
<TD class="confluenceTd">maps</TD>
<TD class="confluenceTd">A comma-separated list of DataMap names within the project, whoose entities data needs to be ported. If ommitted, all DataMaps in the project will be ported.</TD>
<TD class="confluenceTd">No</TD>
</TR>
<TR>
<TD class="confluenceTd">srcNode</TD>
<TD class="confluenceTd">Source DataNode name.</TD>
<TD class="confluenceTd">Yes</TD>
</TR>
<TR>
<TD class="confluenceTd">destNode</TD>
<TD class="confluenceTd">Destination DataNode name.</TD>
<TD class="confluenceTd">Yes</TD>
</TR>
<TR>
<TD class="confluenceTd">cleanDest</TD>
<TD class="confluenceTd">If false, will skip deleting data from the destination tables. True is default.</TD>
<TD class="confluenceTd">No</TD>
</TR>
<TR>
<TD class="confluenceTd">includeTables</TD>
<TD class="confluenceTd">Comma-separated list of tables to include in the port. If ommitted, all mapped DbEntities will be used. It is possible to use &quot;*&quot; to indicate name patterns.</TD>
<TD class="confluenceTd">No</TD>
</TR>
<TR>
<TD class="confluenceTd">excludeTables</TD>
<TD class="confluenceTd">Comma-separated list of tables to exclude from the port. If ommitted, all mapped DbEntities will be used. It is possible to use &quot;*&quot; to indicate name patterns.</TD>
<TD class="confluenceTd">No</TD>
</TR>
</TBODY></TABLE>
</DIV>
<H5><A name="cdataport-Examples"></A>Examples</H5>
<P>Here is an example of using <TT>cdataport</TT> to port data using all source DataMaps, excluding DBEntities with name matching &quot;BILL_*&quot;:</P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-xml"><SPAN class="code-tag">&lt;cdataport projectFile=<SPAN class="code-quote">&quot;subdir/cayenne.xml&quot;</SPAN> srcNode=<SPAN class="code-quote">&quot;ProductionNode&quot;</SPAN> destNode=<SPAN class="code-quote">&quot;DevNode&quot;</SPAN> excludeTables=<SPAN class="code-quote">&quot;BILL_*&quot;</SPAN>/&gt;</SPAN></PRE>
</DIV></DIV>