Robert Lor's Weblog
OFBiz and PostgreSQL
There are a quite number of Open Source ERP apps out there, but only a few (Compiere/Adempiere, OpenBravo, xTuple, OFBiz) seem to have gained traction. Recently, I tried out OFBiz and getting it to work with PostgreSQL was quite simple. OFBiz is actually shipped with an embedded Java DB (Derby), so for testing or development, you probably don't need an external DB.
I did my test on OpenSolaris 2008.05, so if you use a different version of Solaris or a different OS, the instructions below may vary.
First, check out the source, compile, and run with the embedded database to make sure everything works properly.
- Create a directory where you want OFBiz to reside, and run "svn co http://svn.apache.org/repos/asf/ofbiz/trunk ofbiz"
- Go to the OFBiz directory (now referred to as $OFBIZDIR), and run "./ant run-install"
- In $OFBIZDIR, run "java -jar ofbiz.jar"
- Once OFBiz is started, check out the sample app by pointing the browser to http://localhost:8080/ecommerce/
Once your have it working with Derby, follow the steps below to switch to PostgreSQL. I use version 8.3.x.
-
Assuming you have Postgres installed and ready to go, run:
postgres $ createuser -S -D -R -P -E ofbiz
postgres $ createdb -O ofbiz ofbizdb
-
Edit the OFBiz DB config file in $OFBIZDIR/framework/entity/config/entityengine.xml
<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"/>
...
</delegator>
<datasource name="localpostnew"
...
<inline-jdbc
jdbc-driver="org.postgresql.Driver"
jdbc-uri="jdbc:postgresql://127.0.0.1:5432/ofbizdb"
jdbc-username="ofbiz"
jdbc-password="ofbiz"
isolation-level="ReadCommitted"
pool-minsize="2"
pool-maxsize="250"/>
</datasource>
- Copy PostgreSQL JDBC driver to $OFBIZDIR/framework/entity/lib/jdbc. Make sure to use the JDBC4 driver.
- Go to $OFBIZDIR, and run "./ant run-install" to populate the data in PostgreSQL
- Re/start OFBiz by running "java -jar ofbiz.jar"
- Once OFBiz is up and running, you should be able to access http://localhost:8080/ecommerce/
That's all there is to it.
Jignesh has a post on setting up OpenBravo with Postgres on OpenSolaris 2008.05.
Posted at 05:15PM Oct 31, 2008 by Robert Lor in PostgreSQL | Comments[2]
very useful
;)
thanks Robert
Don't you know also a way to make Compiere work with PostgreSql?
(I've tried with that too, but so far I was just able to make it work with PostgreSql Plus)
I've seen a guide online, but it seems only to be for earlier versions of compiere (ndr 2.5) and postgresql.
I've not been able to set it up yet
steve
Posted by steve on November 14, 2008 at 09:06 AM CST #
Steve,
I haven't worked with Compiere, but according to their website, it only supports EDB Postgres Plus Advanced Server, not PostgreSQL Plus or the community PostgreSQL. You can get more info from this link http://www.compiere.com/products/platform/database.php
Posted by Robert Lor on November 14, 2008 at 09:24 AM CST #