OFBiz and PostgreSQL
By rnl on Oct 31, 2008
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"/>
- 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/