Pages

Thursday 6 February 2014

Liferay Database Migration

Hi friends,
              From liferay 6.1 it becomes very easy to migrate database of liferay from  its default hqDB to your desired database life Mysql, MSSQl, PostSql from control panel. In this post I will tell you how to achieve this both from control panel & by using portal-ext.properties file.



From Control panel.

1. login as admin in your liferay portal.
2.Go to control panel.
3. Chosse  from right hand panel--->server-server administrator--->Data Migration tab
4. be sure you have connector .jar for your particular jar. Mysql.jar is already placed in liferay portal so no need to do any staff.
put driver class as--->com.mysql.jdbc.Driver
JDBC url--->jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
user-->username of lportal
password-->password of database
than click on execute.


that it the portal will restart by its own & migrate all data in your database.


From portal-ext.properties file.

1.Open location
liferay root->tomcat-->webapp-->root-->WEB-INF-->classes
2.create a new file portal-ext.properties here
and paste this content as it as for my sql.


jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=root
jdbc.default.password=password




above explaination

first line is used for driver class.

second line is used for giving the url where database server is running here i have used localhost after that database name which you want to use for migration.(lportal in my case)

third line used for username of database which have all permissions.

fourth line contains password of that user.


after that save this file & restart the liferay server & you will see the tables in your own database.

please download the portal-ext.properties file from here if you have any trouble.