OFBiz II--migrating ofbiz from Derby to MySQL

Source: Internet
Author: User

"Step One"

Build three databases in MySQL database ofbiz, Ofbizolap, ofbiztenant, unified all common UTF-8 codes

"Step Two"

Open the Entity engine configuration file

/framework/entity/config/entityengine.xml

modifying DataSource, Delegator nodes

Add the following data sources:

  <datasource name= "Localmysql"              helper-class= "Org.ofbiz.entity.datasource.GenericHelperDAO"              field-type-name= "MySQL"              check-on-start= "true"              add-missing-on-start= "true"              check-pks-on-start= "false"              Use-foreign-keys= "true"             join-style= " Ansi-no-parenthesis "            alias-view-columns = "false"              Drop-fk-use-foreign-key-keyword= "true"     &nbsP;       table-type= "InnoDB"              character-set= "UTF8"              collate= "Utf8_general_ci" >        <read-data  Reader-name= "tenant"/>        <read-data reader-name= "seed" />        <read-data reader-name= "Seed-initial"/>         <read-data reader-name= "Demo"/>         <read-data reader-name= "ext"/>         <read-data reader-name= "Ext-test"/>        < Read-data reader-name= "Ext-demo"/>        <inline-jdbc      &nbsP;          jdbc-driver= "Com.mysql.jdbc.Driver"                  jdbc-uri= "jdbc:mysql:// Localhost/ofbiz?autoreconnect=true "                 jdbc-username= "Root"                  jdbc-password= "Root"                  isolation-level= "ReadCommitted"                  pool-minsize= "2"                  pool-maxsize= "     "            time-between-eviction-runs-millis= "600000"/ ><!--&NBSP;PLEASE&Nbsp;note that at least one person has experienced a problem  with this value with mysql                 and had to set it to -1 in order  to avoid this issue.                 for more look at http://markmail.org/thread/5sivpykv7xkl66px  and http://commons.apache.org/dbcp/configuration.html-->         <!-- <jndi-jdbc jndi-server-name= "Localjndi"  jndi-name= "Java:/mysqldatasource " isolation-level=" Serializable "/> -->    </datasource>     <datasource name= "Localmysqlolap"              helper-class= "Org.ofbiz.entity.datasource.GenericHelperDAO"              field-type-name= "MySQL"              Check-on-start= "true"              Add-missing-on-start= "true"              Check-pks-on-start= "false"              Use-foreign-keys= "true"             join-style= " Ansi-no-parenthesis "            alias-view-columns = "false"              Drop-fk-use-foreign-key-keyword= "true"              Table-type= "InnoDB"             character-set= "UTF8"             collate= "utf8 _general_ci ">        <read-data reader-name=" tenant "/>         <read-data reader-name= "Seed"/>         <read-data reader-name= "Seed-initial"/>         <read-data reader-name= "Demo"/>         <read-data reader-name= "ext"/>        <read-data  Reader-name= "Ext-test"/>        <read-data reader-name= " Ext-demo "/>        <inline-jdbc                 jdbc-driver= "Com.mysql.jdbc.Driver"       &nbSp;          jdbc-uri= "Jdbc:mysql://localhost/ofbizolap? Autoreconnect=true "                 jdbc-username= "Root"                  jdbc-password= "Root"                  isolation-level= "ReadCommitted"                  pool-minsize= "2"                  pool-maxsize= "        "         time-between-eviction-runs-millis= "600000"/><!--  please note that at least one person has experienced a  Problem with this value with mysql                 and had to set it to -1 in order to avoid  this issue.                 For more look at http://markmail.org/thread/5sivpykv7xkl66px and  http://commons.apache.org/dbcp/configuration.html-->        <!--  <jndi-jdbc jndi-server-name= "Localjndi"  jndi-name= "Java:/mysqldatasource"   Isolation-level= "Serializable"/> -->    </datasource>     <datasource name= "Localmysqltenant"              helper-class= "Org.ofbiz.entity.datasource.GenericHelperDAO"              fiEld-type-name= "MySQL"             check-on-start= " True "            add-missing-on-start=" true "             check-pks-on-start= "false"              use-foreign-keys= "true"              join-style= "Ansi-no-parenthesis"              alias-view-columns= "false"              drop-fk-use-foreign-key-keyword= "true"              table-type= "InnoDB"              character-set= "UTF8"             collate= " Utf8_general_ci "&GT;        <read-data reader-name= "Tenant"/>         <read-data reader-name= "Seed"/>         <read-data reader-name= "Seed-initial"/>         <read-data reader-name= "Demo"/>        <read-data  reader-name= "ext"/>        <read-data reader-name= " Ext-test "/>        <read-data reader-name=" Ext-demo "/>         <inline-jdbc                 jdbc-driver= "Com.mysql.jdbc.Driver"                  jdbc-uri= "Jdbc:mysql://localhost /ofbiztenant?autoreconnect=trUE "                 Jdbc-username= "Root"                  jdbc-password= "Root"                  isolation-level= "ReadCommitted"                  pool-minsize= "2"                  pool-maxsize= "         "        time-between-eviction-runs-millis= "600000"/><!-- Please  note that at least one person has experienced a problem  with this value with MySQL                &nBsp;and had to set it to -1 in order to avoid this  issue.                 for more look at http://markmail.org/thread/5sivpykv7xkl66px and http:// commons.apache.org/dbcp/configuration.html-->        <!--  <jndi-jdbc jndi-server-name= "Localjndi"  jndi-name= "Java:/mysqldatasource"  isolation-level= " Serializable "/> -->    </datasource>

Switch the data source from the default derby to MySQL

<delegator name= "Default"  entity-model-reader= "main"  entity-group-reader= "main"   Entity-eca-reader= "main"  distributed-cache-clear-enabled= "false" >    <group-map  group-name= "org.ofbiz"  datasource-name= "Localmysql"/>    <group-map  Group-name= "Org.ofbiz.olap"  datasource-name= "Localmysqlolap"/>    <group-map  group-name= "Org.ofbiz.tenant"  datasource-name= "Localmysqltenant"/></delegator>      <delegator name= "Default-no-eca"  entity-model-reader= "main"   Entity-group-reader= "main"  entity-eca-reader= "main"  entity-eca-enabled= "false"   Distributed-cache-clear-enabled= "false" >    <group-map group-name= "Org.ofbiz"  datasource-name= "Localmysql"/>    <group-map group-name= "Org.ofbiz.olap"  datasource-name= "Localmysqlolap"/> &nbsP;  <group-map group-name= "Org.ofbiz.tenant"  datasource-name= "Localmysqltenant"/> </delegator> <delegator name= "Test"  entity-model-reader= "main"   Entity-group-reader= "main"  entity-eca-reader= "main" >    <group-map  Group-name= "org.ofbiz"  datasource-name= "Localmysql"/>    <group-map  Group-name= "Org.ofbiz.olap"  datasource-name= "Localmysqlolap"/>    <group-map  group-name= "Org.ofbiz.tenant"  datasource-name= "Localmysqltenant"/></delegator>

Save, re-run with ant, then successfully switch to MySQL

Reference

Https://cwiki.apache.org/confluence/display/OFBIZ/How+to+migrate+OfBiz+from+Derby+to+MySQL+database

OFBiz II--migrating ofbiz from Derby to MySQL

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.