awsliferay

Use Oracle Database with Liferay

Liferay natively allows the use of OracleDB as main data source. If you ever wanted to use a more scalable database and professional for your Liferay installation, here is how.

Step 1: Install JDBC drivers

If you haven’t installed the JDBC driver corresponding to the database server you want to connect, please follow the instructions on how to install the OracleDB driver.

Step 2: Change Liferay DB configuration

  • Stop the stack servers:

    $ sudo /opt/bitnami/ctlscript.sh stop
    
  • Edit the /opt/bitnami/apache-tomcat/webapps/liferay/WEB-INF/classes/portal-ext.properties file and set the following options:

    jdbc.default.driverClassName=oracle.jdbc.driver.OracleDriver
    jdbc.default.url=jdbc:oracle:thin:@DB_HOST:1521:DB_NAME
    jdbc.default.username=DB_USERNAME
    jdbc.default.password=DB_PASSWORD
    

    Don’t forget to substitute all the database parameter placeholders with the corresponding values.

Step 3: Test the connection

  • Start the servers again:

    $ sudo /opt/bitnami/ctlscript.sh restart tomcat
    

If everything was configured correctly, you should be able to log in to Liferay.

Step 4 (Optional): Disable MySQL

To permanently disable MySQL in the stack, so that it is never started and does not waste any resource, execute the commands below:

    $ sudo /opt/bitnami/ctlscript.sh stop mysql
    $ sudo sed -i '1i exit 0' /opt/bitnami/mysql/scripts/ctl.sh