Roufid

Setup Liferay DB2 Database

Follow these instructions to configure your Liferay portal with DB2 SGBD :

To download the DB2 jdbc Driver, follow these instructions :

  1. Go to the official IBM site
  2. Choose the appropriate driver version according to your DB2 Version.  I’m using DB2 10.5, so the appropriate JDBC Driver is 3.6646. Click on the appropriate version
  3. On the next window, select the IBM Data Server Driver for JDBC and click on “Continue”
  4. If you don’t have an IBM Identity, you must sign up
  5. At the end of the process, you must have an archive named v**.****_jdbc_sqlj.tar.gz. Download it
  6. Unzip the gz archive, you will have another archive called v**.****_jdbc_sqlj.tar.
  7. Unzip the tar archive, you will have jdbc_sqlj folder under which you have another archive called db2_db2driver_for_jdbc_sqlj.zip
  8. Unzip the db2_db2driver_for_jdbc_sqlj.zip (the last unzipping, i promise)
  9. Copy the db2jcc.jar and past it under $TOMCAT_HOME/lib/ext

Create now the blank database.  Let’s consider that the created database islportal. Below the command to do it :

Open your portal-ext.properties file and past the following lines :

Set the correct username and password to connect to your database.

The portal-ext.properties is located in the same folder as your $TOMCAT_HOME. If it doesn’t exist, create it.

portal-ext.properties location

During the server start, you can verify that Liferay started with the correct dialect (DB2) by looking for the following line in your server log console/file:

If you go back to your database, you will see that it’s now populated by about 180 data tables that Liferay created on startup.

If you already configured your portal with hsql and want to re-configured it with the DB2 Database and add samples data, open portal-setup-wizard.properties file located in the same folder as  portal-ext.properties. Set the setup.wizard.enabled to true and restart your server.