Reputation: 2311
As of today, I am developing the liferay portal enhancements with default hsql database. I have implemented many features and created multiple sites and site templates with different roles and user.
1) Now I want to change the database from hsql database to PostgreSQL. Now how can I change the database with losing any data (sites, users, roles and site templates)?
2) I have a web application which is deployed another tomcat instance. Now I want to perform the liferay database transaction from the servlet. transactions means need to get the user details based on the emailId or ScreenName?
Can anyone please confirm that how can I do the above tasks and It will be very thankful If any one suggest some useful tutorials.procedure to do the same.
Upvotes: 0
Views: 680
Reputation: 1052
To change your database from hsql to PostgreSQL the best options are either change the portal-ext.properties of you portal with:
#
# PostgreSQL Config
#
jdbc.default.driverClassName=org.postgresql.Driver
jdbc.default.url=jdbc:postgresql://localhost:5432/***databasename***
jdbc.default.username=
jdbc.default.password=
or in you /tomcat/conf/context.xml you can define some like this:
<Resource auth="Container" driverClassName="org.postgresql.Driver" maxActive="20" name="jdbc/LiferayPool" password="" type="javax.sql.DataSource" url="jdbc:postgresql://localhost:5432/**database name**" username=""/>
For your second question I think that you can use the Liferay web services. You can see them in you portal relative url:
/api/jsonws
Upvotes: 0
Reputation: 590
1.) You can migrate your data via the Control Panel. Navigate to Server Administration, there is a tab: Data Migration. You provide the credentials of the new Database and hit submit. That's all. 2.) I do not undstand your 2.nd Question to be honest.
Upvotes: 1