Pages

Showing posts with label Configure any database to the liferay. Show all posts
Showing posts with label Configure any database to the liferay. Show all posts

Thursday, 12 April 2012

Configure any database to the liferay

configure any database to the liferay


Important files & locations:-
portal-impl.jar :- Liferay_Home\tomcat-6.0.29\webapps\ROOT\WEB-INF\lib
Portal.properties:- Present in servelet-impl.jar (Jar files can be open by WinZip or use java decompiler). Contain all the portlet related properties.
Portal-ext.properties:- Create and place at
Liferay_Home\tomcat-6.0.29\webapps\ROOT\WEB-INF\classes (or) Liferay_Home
Before configure any database to the liferay:-
When liferay Tomcat is started, it reads portal.properties file and database related name value pairs has the following data is uncommented and it configure hypersonic as db.
# Hypersonic
jdbc.default.driverClassName=org.hsqldb.jdbcDriver
jdbc.default.url=jdbc:hsqldb:${liferay.home}/data/hsql/lportal
jdbc.default.username=sa
jdbc.default.password=
Steps to configure MySQL to liferay:-
1)      Install MySQL database server and MySQL gui.
2)      Open MySQL gui and Create one schema named as liferay_db(No tables are created)
3)      Create portal-ext.properties file with the following data and place in the above specified location.(Note:- File name should be portal-ext.propeties otherwise tomcat is unable to read)
# MySQL
     jdbc.default.driverClassName=com.mysql.jdbc.Driver   
jdbc.default.url=jdbc:mysql://localhost/liferay_db?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=root
jdbc.default.password=root
After configuring MySQL database to the liferay following things happen:-
1)      Start the tomcat
2)      Tomcat read portal.properties file form portal-impl.jar, and assumed as hypersonic is the database
3)      Then tomcat read portal-ext.properties file, in which database name value pairs are overridden.
4)      Database is determined as MySQL.
5)      Create tables and populate with default data.