Portal 6 with Derby DB

These are some quick steps how to use Derby DB with Portal 6.

(1) Prepare Portal Database

This shall be done only once.

+  modify derby/bin/ij.bat by adding:

set DERBY_OPTS="-Dderby.system.home=c:\liferay\bundles\data\derby"

+ start ij.bat and create the database:

connect 'jdbc:derby:lportal;create=true;user=liferay;password=liferay';quit;

+ create derby.properties in liferay/bundles/data/derby_opts . This file contains Derby DB settings and may looks like:

# when running embedded mode, also start the network server
#derby.drda.startNetworkServer=true

# Listen on all interfaces (allow connections from other IPs, not just localhost)
#derby.drda.host=0.0.0.0

# Turn on authentication - a good move when running network server
derby.connection.requireAuthentication=true

# hard code a user/password for username liferay, change to use LDAP or RDBMS users etc...
derby.user.liferay=liferay

 

(2) Integration with portal

+ Add derby.jar to liferay/bundles/tomcat-xxx/lib/ext

+ modify portal-ext.properties to set Derby DB connection:

jdbc.default.driverClassName=org.apache.derby.jdbc.EmbeddedDriver
jdbc.default.url=jdbc:derby:lportal
jdbc.default.username=liferay
jdbc.default.password=liferay

+ add Tomcat VM parameter for Derby DB home:

-Dderby.system.home=c:\liferay\bundles\data\derby

 

When started, portal should print out something like this:

... Determining dialect for Apache Derby 10
... Using dialect org.hibernate.dialect.DerbyDialect