| 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 "*" 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 "*" 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 "BILL_*":</P> |
| |
| <DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent"> |
| <PRE class="code-xml"><SPAN class="code-tag"><cdataport projectFile=<SPAN class="code-quote">"subdir/cayenne.xml"</SPAN> srcNode=<SPAN class="code-quote">"ProductionNode"</SPAN> destNode=<SPAN class="code-quote">"DevNode"</SPAN> excludeTables=<SPAN class="code-quote">"BILL_*"</SPAN>/></SPAN></PRE> |
| </DIV></DIV> |