Hi,
I'm looking for some help about migrating from ofbiz derby database to postgresql database, and also how to create and set data directly from postgresql without having to pass by derby. According to tutorials that I have, I can't find how they get connected to another database (postgres in my case) and defining entities there, and keep developing the application. P.S : * I'm using Eclipse IDE * I'm just a beginner in ofbiz so I have just few knowledge about the OFBiz environement. Thank you for you help :) |
Hello,
Take back up of your derby database and import it into postgresql database after tis installation. For migrating from derby database to postgresql database open framework/entity/config/entityengine.xml and do the following changes in datasource-name field: <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="localpostgres"/> <group-map group-name="org.ofbiz.olap" datasource-name="localpostgres"/> </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="localpostgres"/> <group-map group-name="org.ofbiz.olap" datasource-name="localpostgres"/> <group-map group-name="org.ofbiz.tenant" datasource-name="localderbytenant"/> </delegator> Enter jdbc-username and jdbc-password of postgres database here: <datasource name="localpostgres" helper-class="org.ofbiz.entity.datasource.GenericHelperDAO" schema-name="public" field-type-name="postgres" check-on-start="true" add-missing-on-start="true" use-fk-initially-deferred="false" <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"/> <inline-jdbc jdbc-driver="org.postgresql.Driver" jdbc-uri="jdbc:postgresql://127.0.0.1/trunk" jdbc-username="Your postgres Database User Name" jdbc-password="Your postgres Database Password" time-between-eviction-runs-millis="600000"/> </datasource> and then open the console, browse to ofbiz folder and run this command: ant download-PG-JDBC I think this information help you. Thank you. Regards Arun Kumar Batham HotWax Media, Est. 1997 http://www.hotwaxmedia.com/ On Tuesday 29 May 2012 06:41 PM, G.Ben wrote: > Hi, > > I'm looking for some help about migrating from ofbiz derby database to > postgresql database, and also how to create and set data directly from > postgresql without having to pass by derby. > According to tutorials that I have, I can't find how they get connected to > another database (postgres in my case) and defining entities there, and keep > developing the application. > > P.S : * I'm using Eclipse IDE > * I'm just a beginner in ofbiz so I have just few knowledge about the > OFBiz environement. > > Thank you for you help :) > > -- > View this message in context: http://ofbiz.135035.n4.nabble.com/OFBIZ-PostgreSQL-tp4632713.html > Sent from the OFBiz - User mailing list archive at Nabble.com. |
This FAQ
https://cwiki.apache.org/confluence/display/OFBIZ/How+to+migrate+OfBiz+from+Derby+to+MySQL+database should help. Simply ignore *references & changes related to MySQL*, instead execute postgres datasource configuration steps provided by Arun Kumar Batham. On Tue, May 29, 2012 at 7:13 PM, Arun Kumar Batham < [hidden email]> wrote: > Hello, > > Take back up of your derby database and import it into postgresql database > after tis installation. > > For migrating from derby database to postgresql database open > framework/entity/config/**entityengine.xml and > do the following changes in datasource-name field: > > <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="**localpostgres"/> > <group-map group-name="org.ofbiz.olap" datasource-name="**localpostgres"/> > </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="**localpostgres"/> > <group-map group-name="org.ofbiz.olap" datasource-name="**localpostgres"/> > <group-map group-name="org.ofbiz.tenant" datasource-name="** > localderbytenant"/> > </delegator> > > Enter jdbc-username and jdbc-password of postgres database here: > > <datasource name="localpostgres" > helper-class="org.ofbiz.**entity.datasource.**GenericHelperDAO" > schema-name="public" > field-type-name="postgres" > check-on-start="true" > add-missing-on-start="true" > use-fk-initially-deferred="**false" > <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"/> > <inline-jdbc > jdbc-driver="org.postgresql.**Driver" > jdbc-uri="jdbc:postgresql://12**7.0.0.1/trunk<http://127.0.0.1/trunk> > " > jdbc-username="Your postgres Database User Name" > jdbc-password="Your postgres Database Password" > time-between-eviction-runs-**millis="600000"/> > </datasource> > > and then open the console, browse to ofbiz folder and run this command: > > ant download-PG-JDBC > > I think this information help you. > > Thank you. > > Regards > Arun Kumar Batham > HotWax Media, Est. 1997 > http://www.hotwaxmedia.com/ > > > > On Tuesday 29 May 2012 06:41 PM, G.Ben wrote: > >> Hi, >> >> I'm looking for some help about migrating from ofbiz derby database to >> postgresql database, and also how to create and set data directly from >> postgresql without having to pass by derby. >> According to tutorials that I have, I can't find how they get connected to >> another database (postgres in my case) and defining entities there, and >> keep >> developing the application. >> >> P.S : * I'm using Eclipse IDE >> * I'm just a beginner in ofbiz so I have just few knowledge about >> the >> OFBiz environement. >> >> Thank you for you help :) >> >> -- >> View this message in context: http://ofbiz.135035.n4.nabble.** >> com/OFBIZ-PostgreSQL-**tp4632713.html<http://ofbiz.135035.n4.nabble.com/OFBIZ-PostgreSQL-tp4632713.html> >> Sent from the OFBiz - User mailing list archive at Nabble.com. >> > -- Regards, Varun Bhansaly |
In reply to this post by Arun Kumar Batham
Hello Arun Kumar Batham,
I followed the steps but however ... I get errors at the console Thank you for your help. |
In reply to this post by G.Ben
I've already tried this website http://www.toivari.com/devblog/page/2/ and I've just had 852 tables for the ofbie database and 0 tables for ofbizolap and ofbiztenant databse.
Now when I checked entityengine.xml I've noticed that it has been changed -_-" So I followed your steps above and that was the error message that I've got. |
Hello G. Ben,
Please apply this steps: Open your Command prompt, Browse to your ofbiz directory and run this command: ant download-PG-JDBC I think this information help you. Thank you. Regards Arun Kumar Batham HotWax Media, Est. 1997 http://www.hotwaxmedia.com/ On Wednesday 30 May 2012 08:45 PM, G.Ben wrote: > I've already tried this website http://www.toivari.com/devblog/page/2/ > http://www.toivari.com/devblog/page/2/ and I've just had 852 tables for the > ofbie database and 0 tables for ofbizolap and ofbiztenant databse. > Now when I checked entityengine.xml I've noticed that it has been changed > -_-" So I followed your steps above and that was the error message that I've > got. > > -- > View this message in context: http://ofbiz.135035.n4.nabble.com/OFBIZ-PostgreSQL-tp4632713p4632793.html > Sent from the OFBiz - User mailing list archive at Nabble.com. |
In reply to this post by G.Ben
Hello Ben,
Hello, For migrating from derby database to postgresql database open framework/entity/config/entityengine.xml and do the following changes in datasource-name field: <connection-factory class="org.ofbiz.entity.connection.DBCPConnectionFactory"/> <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="localpostnew"/> <group-map group-name="org.ofbiz.olap" datasource-name="localpostolap"/> <group-map group-name="org.ofbiz.tenant" datasource-name="localposttenant"/> </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="localpostnew"/> <group-map group-name="org.ofbiz.olap" datasource-name="localpostolap"/> <group-map group-name="org.ofbiz.tenant" datasource-name="localposttenant"/> </delegator> <delegator name="test" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main"> <group-map group-name="org.ofbiz" datasource-name="localpostnew"/> <group-map group-name="org.ofbiz.olap" datasource-name="localpostolap"/> <group-map group-name="org.ofbiz.tenant" datasource-name="localposttenant"/> </delegator> Enter jdbc-username and jdbc-password of postgres database here: <datasource name="localpostnew" helper-class="org.ofbiz.entity.datasource.GenericHelperDAO" schema-name="public" field-type-name="postnew" check-on-start="true" add-missing-on-start="true" use-fk-initially-deferred="false" alias-view-columns="false" join-style="ansi" result-fetch-size="50" use-binary-type-for-blob="true"> <read-data reader-name="seed"/> <read-data reader-name="seed-initial"/> <read-data reader-name="demo"/> <read-data reader-name="ext"/> <inline-jdbc jdbc-driver="org.postgresql.Driver" jdbc-uri="jdbc:postgresql://localhost:5432/ofbiz" jdbc-username="ofbiz" jdbc-password="ofbiz" isolation-level="ReadCommitted" pool-minsize="2" pool-maxsize="250" time-between-eviction-runs-millis="600000"></inline-jdbc> </datasource> <datasource name="localpostolap" helper-class="org.ofbiz.entity.datasource.GenericHelperDAO" schema-name="public" field-type-name="postnew" check-on-start="true" add-missing-on-start="true" use-fk-initially-deferred="false" alias-view-columns="false" join-style="ansi" result-fetch-size="50" use-binary-type-for-blob="true" use-order-by-nulls="true"> <read-data reader-name="seed" /> <read-data reader-name="seed-initial" /> <read-data reader-name="demo" /> <read-data reader-name="ext" /> <inline-jdbc jdbc-driver="org.postgresql.Driver" jdbc-uri="jdbc:postgresql://localhost:5432/ofbizolap" jdbc-username="ofbiz" jdbc-password="ofbiz" isolation-level="ReadCommitted" pool-minsize="2" pool-maxsize="250" time-between-eviction-runs-millis="600000" /> </datasource> <datasource name="localposttenant" helper-class="org.ofbiz.entity.datasource.GenericHelperDAO" schema-name="public" field-type-name="postnew" check-on-start="true" add-missing-on-start="true" use-fk-initially-deferred="false" alias-view-columns="false" join-style="ansi" result-fetch-size="50" use-binary-type-for-blob="true" use-order-by-nulls="true"> <read-data reader-name="seed" /> <read-data reader-name="seed-initial" /> <read-data reader-name="demo" /> <read-data reader-name="ext" /> <inline-jdbc jdbc-driver="org.postgresql.Driver" jdbc-uri="jdbc:postgresql://localhost:5432/ofbiztenant" jdbc-username="ofbiz" jdbc-password="ofbiz" isolation-level="ReadCommitted" pool-minsize="2" pool-maxsize="250" time-between-eviction-runs-millis="600000" /> </datasource> and then after put the jar of postgresql-8.0-311.jdbc2.jar in the path framework/entity/lib/jdbc after this go to commond prompt and write the commond ant run-istall after complitoin of this write the command startofbiz.bat Go to browser and put the URL https://localhost:8443/humanres/control/main This process for window machin. I think this information help you. Thanks Dhiraj Gupta 09990220686
Dhiraj Gupta
|
In reply to this post by Arun Kumar Batham
Hi Arun Kumar Batham,
I've already typed the command and above, you can see that build has failed ... Thank you. Regards. G.Ben |
In reply to this post by dhiraj.g
Hi Dhiraj Gupta,
I will try the steps and see what I'll get. Thank you so much for your help. Regards. G.Ben. |
In reply to this post by G.Ben
In order to use postgresql do the following steps (Replace the example database names, database user and its password by your application specific names )
1. Create a database in postgresql example myDbName 2. Create a database user ex dbUser identified by password ex dbPassword 3. Grant access to this dbUser on the database in this ex on myDbName 4. Create two more databases for olap and tenant ex olapDbName and tenantDbName . 5. Grant access to dbUser on these two databases also. Now after creating three databases and a db user change the framework/entity/config/entityengine.xml file I am attaching a sample entityengine.xml file with above mentioned databases and database user. have a look at the attached file and search for above mentioned example database names to see how to and where to change. After making above mentioned changes execute following commands. 1. Stop the ofbiz server if running. 2. Run ant download-PG-JDBC command 3. ant run-install. 4. startofbiz Regards Mohd Viqar
|
Thank you all for your help,
It worked finally. Regards. G.Ben. |
Hi ,
Currently i am using ofbiz with mysql. I am planning to migrate mysql to postgres to my production environment. what are all the changes has to be made in ofbiz to get success postgres connection. |
Free forum by Nabble | Edit this page |