掲示板

Database Configuration Changed in 5.2

thumbnail
15年前 に JR Houn によって更新されました。

Database Configuration Changed in 5.2

Expert 投稿: 488 参加年月日: 07/11/19 最新の投稿
Hi Everyone,
The Liferay 5.2 release is imminent (hopefully being packaged over the weekend), I wanted to get one important bit of information out to the potential users of 5.2. The method of configuring your app server with your database of choice has changed significantly from previous versions; here is an excerpt from the updated wiki article:
Liferay v5.2 unifies the configuration of the database in a single file for all application servers. As most other configuration options you can set this up in the portal(-ext).properties file as follows (example for MySQL):
jdbc.default.driver=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=
jdbc.default.password=
The portal.properties file has examples for all the main databases supported.
Note that this system uses the apache commons pool for pooling connections to the database. If you prefer to use the pooling mechanism provided by the portal application server you can still do that through spring. In particular add this to the ext-spring.xml file:
<bean id="liferayDataSource"
class="org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy">
<property name="targetDataSource">
<bean
class="com.liferay.portal.spring.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="jdbc/LiferayPool" />
</bean>
</property>
</bean>
This file can be found in your extension environment. If you are not using this environment just create an Spring configuration file with that name and add it to the META-INF dir of your installation.

Hope this helps everyone avoid any surprising gotchas on 5.2 day. emoticon
Regards,
jr
15年前 に Timothy Overly によって更新されました。

RE: Database Configuration Changed in 5.2

New Member 投稿: 4 参加年月日: 08/12/07 最新の投稿
The following would not work for me:

jdbc.default.driver=com.mysql.jdbc.Driver

It worked as following:

jdbc.default.driverClassName=com.mysql.jdbc.Driver
thumbnail
15年前 に steve rieger によって更新されました。

RE: Database Configuration Changed in 5.2

Expert 投稿: 436 参加年月日: 06/09/11 最新の投稿
am misunderstanding you

my context.xml file looks like this

<Context>
<!--<Resource
name="jdbc/JIRAPool"
auth="Container"
type="javax.sql.DataSource"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/jira?useUnicode=true&amp;characterEncoding=UTF-8&amp;emulateLocators=true&amp;useFastDateParsing=false"
username=""
password=""
maxActive="20"
/>-->
</Context>

pwd
webapps/wol-portlet/META-INF

i think that the following line
url="jdbc:mysql://localhost/jira?useUnicode=true&amp;characterEncoding=UTF-
should be changed to
url="jdbc:mysql://localhost/lportal?useUnicode=true&amp;characterEncoding=UTF-
thumbnail
15年前 に steve rieger によって更新されました。

RE: Database Configuration Changed in 5.2

Expert 投稿: 436 参加年月日: 06/09/11 最新の投稿
am using mysql as the db
cat ./webapps/ROOT/WEB-INF/classes/portal-ext.properties

# MySQL
#
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/liferay52?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=user
jdbc.default.password=passwd

am having issues putting liferap portal (tomcat bundle) on mysql

can somebody please provide instructions, it seems to work (i see changes in mysql, however when i restart tomcat all the changes go away and it reverts to the default page...

thank you in advance.
thumbnail
15年前 に Rinaldo S DiGiorgio によって更新されました。

RE: Database Configuration Changed in 5.2

New Member 投稿: 15 参加年月日: 09/01/31 最新の投稿
Hello,

I just downloaded the 1/25/09 glassfish bundle. I want to use MySQL as the store. I don't see any of the files you mention in my distribution. Do I have to create them? How do I go from using the default embedded database to a mysql configuration.


Rinaldo
thumbnail
15年前 に steve rieger によって更新されました。

Re: [Liferay Forums][1. Installation / Deployment / Setup] RE: DatabaseConf

Expert 投稿: 436 参加年月日: 06/09/11 最新の投稿
Yes you have to create the portal-ext.properties file

If you create that file and start liferay it will populate the db for you



--
Sent via Blackberry
I can be reached at 310-947-8565
15年前 に Jason Boyle によって更新されました。

RE: Re: [Liferay Forums][1. Installation / Deployment / Setup] RE: Database

New Member 投稿: 3 参加年月日: 09/02/03 最新の投稿
after creating the portal-ext.properties file with the config items, what else needs to be done to switch from hypersonic to MySQL? My tomcat-55 bundle install is still trying to use hsdb..
As someone who's not a developer, trying to get into using Liferay, I have found it to be a very frustrating experience so far emoticon
thanks for anyone's guidance or pointers..
edit: nevermind - i was not placing my file into the /webapps/ROOT/WEB-INF/classes dir.

But now the startup connects, creates the tables in the DB, but still uses hypersonic - is it possible to configure a bundle to use MySQL w/o re-compiling?
15年前 に Kevin S Neibarger によって更新されました。

RE: Re: [Liferay Forums][1. Installation / Deployment / Setup] RE: Database

New Member 投稿: 12 参加年月日: 08/12/04 最新の投稿
Hi Jason - It's actually rather simple to switch databases. Just go to $LIFERAY_HOME\tomcat\conf\Catalina\localhost\ROOT.xml

And comment out the Hypersonic definition and uncomment the MySQL definition such as:

<!-- Hypersonic

<Resource
name="jdbc/LiferayPool"
auth="Container"
type="javax.sql.DataSource"
driverClassName="org.hsqldb.jdbcDriver"
url="jdbc:hsqldb:lportal"
username="sa"
password=""
maxActive="20"
/>-->

<!-- MySQL -->

<Resource
name="jdbc/LiferayPool"
auth="Container"
type="javax.sql.DataSource"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/lportal?useUnicode=true&amp;characterEncoding=UTF-8&amp;useFastDateParsing=false"
username="root"
password="admin"
maxActive="20"
/>

that should do it.
15年前 に Jason Boyle によって更新されました。

RE: Re: [Liferay Forums][1. Installation / Deployment / Setup] RE: Database

New Member 投稿: 3 参加年月日: 09/02/03 最新の投稿
i thought the whole point of 5.2 was that there was only one place needed to modify db settings.. The bundled 5.2 root.xml file is pretty empty, and doesn't contain any DB settings.

it looks like i got things mostly working by copying the source's "portal.properties" file, creating a portal-ext.properties" file with the MySQL settings in there (dis/enabling the ones inside the portal.properties file didn't work..), and copying both to the ROOT/web-inf/classes dir.

i still get some references to hypersonic upon starting up the app, but i'm using the DB now and luckily haven't come across any problems so far within the 7cogs/demo site..
thumbnail
15年前 に Josh Asbury によって更新されました。

RE: Re: [Liferay Forums][1. Installation / Deployment / Setup] RE: Database

Expert 投稿: 498 参加年月日: 06/09/08 最新の投稿
Jason -
I'm seeing the same behavior.
JR -
Any thoughts?
Thanks,
Josh

21:55:08,218 INFO [DialectDetector:64] Determining dialect for MySQL 5
21:55:08,219 INFO [DialectDetector:97] Using dialect org.hibernate.dialect.MySQLDialect
21:55:09,586 INFO [DialectDetector:64] Determining dialect for HSQL Database Engine 1
21:55:09,587 WARN [DialectDetector:79] Liferay is configured to use Hypersonic as its database. Do NOT use Hypersonic in production. Hypersonic is an embedded database useful for development and demo'ing purposes. The database settings can be changed in portal.properties.
21:55:09,594 INFO [DialectDetector:97] Using dialect org.hibernate.dialect.HSQLDialect
thumbnail
15年前 に Josh Asbury によって更新されました。

RE: Re: [Liferay Forums][1. Installation / Deployment / Setup] RE: Database

Expert 投稿: 498 参加年月日: 06/09/08 最新の投稿
Looks like the wol-portlet is somehow bringing in HSQL. Try removing it and then starting Tomcat.

I'll see if I can figure out where this is happening and let everyone know...
15年前 に Kevin S Neibarger によって更新されました。

RE: Re: [Liferay Forums][1. Installation / Deployment / Setup] RE: Database

New Member 投稿: 12 参加年月日: 08/12/04 最新の投稿
I'm actually using 5.1.2 not 5.2. I don't know if that makes a difference. I'm glad you got it working
thumbnail
15年前 に Nicholas Ho によって更新されました。

RE: Re: [Liferay Forums][1. Installation / Deployment / Setup] RE: Database

New Member 投稿: 6 参加年月日: 08/07/03 最新の投稿
Josh Asbury:
Looks like the wol-portlet is somehow bringing in HSQL. Try removing it and then starting Tomcat.

I'll see if I can figure out where this is happening and let everyone know...



Hi Any Luck on this,

I have tried removing 7Cogs as well
then tried editing the portal-ext.properties with the above

Liferay still starts up by HSQL


been working on it all day - help


NickHO
thumbnail
15年前 に Nicholas Ho によって更新されました。

RE: Re: [Liferay Forums][1. Installation / Deployment / Setup] RE: Database

New Member 投稿: 6 参加年月日: 08/07/03 最新の投稿
Hi all,

I got 5.2.1 going with just MYSQL.

Here are the steps
1. Extract the files into /opt
a liferay-portal-5.2.1 directory should be created
DO NOT start liferay at this stage otherwise you will be stuck with the HSQL database

2. Delete the following portlet - these portlet will make request from the HSQL database and make it impossible for you to transition out to use the MYSQL database

3. Delete the following directories from liferay-portal-5.2.1/tomcat-5.5.27/webapps
sevencogs-hook
sevencogs-theme
wol-portlet

4. Make sure you have Mysql running
# /etc/init.d/mysql status | start

create database lportal;
grant a user eg "lportal" and grant all permission to lportal

5. Create a portal-ext.properties file
place the file in /liferay .../tomacat-5.5.27/webapps/ROOT/WEB-INF/classes
Place the following lines in the portal-ext.properties file

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

6. startup liferay
once the above steps have been completed then
CD /opt/liferay-portal-5.2.1/tomcat-5.5.27/bin

# ./setenv.sh (to ensure environment is ok)
# ./startup.sh

The script will auto populate the mysql database

If you are executing these commands on the server console and you have access to the GUI
Firefox will automatically startup with liferay portlet will display on port 8080 (takes 2 minutes)

Good Luck

NickHo
15年前 に Suresh Damodaran によって更新されました。

RE: Re: [Liferay Forums][1. Installation / Deployment / Setup] RE: Database

New Member 投稿: 3 参加年月日: 09/03/06 最新の投稿
Here are the steps you might want to take to upgrade from an earlier version of liferay to 5.2.2. I have done this upgrade from 5.1.2 to 5.2.2 with an existing database (with added custom tables), and custom code in EXT environment. These steps are in addition to the steps outlined by Nicholas earlier.

MOST IMPORTANT: Do not start liferay until Step 4.

1. Backup current liferay database (say, “lportal”)with mysqldump.
mysqldump –u user –p lportal > lportal.sql
2. Backup any new tables you have created separately as “lportal_newtables.sql”
mysqldump –u user –p lportal <names_of_your_tables, if any> > lportal_newtables.sql

3. Run the update scripts for the liferay database as many times as necessary based on database scripts in http://www.liferay.com/web/guest/downloads/additional. Remember to change the database name in the scripts to YOUR databasename.
mysql –u user –p lportal < *update_script*
4. Unbundle Liferay 5.2.2 and make necessary changes to portal-ext.properties file so that Liferay starts up on MySQL. (Optional) To be safe, create a new database (say, newportal), and use “newportal” for the first time start-up. Verify tables are created.
5. Change the database name to the upgraded liferay database (“lportal”), and restart Liferay, verify it works, and shutdown.
6. If you have an EXT environment, do “ant clean deploy” to the new Liferay. I am assuming you have backed up the older EXT environment, and also built new Liferay sources to build the new EXT environment. Restart Liferay, verify it works, shutdown.


Good Luck,

-Suresh




Nicholas Ho:
Hi all,

I got 5.2.1 going with just MYSQL.

Here are the steps
1. Extract the files into /opt
a liferay-portal-5.2.1 directory should be created
DO NOT start liferay at this stage otherwise you will be stuck with the HSQL database

2. Delete the following portlet - these portlet will make request from the HSQL database and make it impossible for you to transition out to use the MYSQL database

3. Delete the following directories from liferay-portal-5.2.1/tomcat-5.5.27/webapps
sevencogs-hook
sevencogs-theme
wol-portlet

4. Make sure you have Mysql running
# /etc/init.d/mysql status | start

create database lportal;
grant a user eg "lportal" and grant all permission to lportal

5. Create a portal-ext.properties file
place the file in /liferay .../tomacat-5.5.27/webapps/ROOT/WEB-INF/classes
Place the following lines in the portal-ext.properties file

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

6. startup liferay
once the above steps have been completed then
CD /opt/liferay-portal-5.2.1/tomcat-5.5.27/bin

# ./setenv.sh (to ensure environment is ok)
# ./startup.sh

The script will auto populate the mysql database

If you are executing these commands on the server console and you have access to the GUI
Firefox will automatically startup with liferay portlet will display on port 8080 (takes 2 minutes)

Good Luck

NickHo
thumbnail
11年前 に Srikanth c によって更新されました。

RE: Re: [Liferay Forums][1. Installation / Deployment / Setup] RE: Database

Regular Member 投稿: 143 参加年月日: 12/10/18 最新の投稿
Hi, Nikolas as u said to remove the folders , i does't have wol portal folder , what should i do?
thumbnail
11年前 に David H Nebinger によって更新されました。

RE: Re: [Liferay Forums][1. Installation / Deployment / Setup] RE: Database

Liferay Legend 投稿: 14914 参加年月日: 06/09/02 最新の投稿
Seriously? You revived this dead thread?

If you need to remove a plugin that is not there, it's already been removed...
15年前 に Suresh Damodaran によって更新されました。

RE: Database Configuration Changed in 5.2

New Member 投稿: 3 参加年月日: 09/03/06 最新の投稿
How can the JNDI resource jdbc/LiferayPool be shared with portlets in 5.2.2?

In 5.2.1 and before, there was an easy way to share by defining
<ResourceLink name="jdbc/LiferayPool" global="LiferayPool"/>
in Catalina/ROOT.xml, and defining the JNDI resource in conf/server.xml

(http://www.liferay.com/web/guest/community/forums/-/message_boards/message/383667)

Thanks for the quick response!
thumbnail
15年前 に Jonas Yuan によって更新されました。

RE: Database Configuration Changed in 5.2

Liferay Master 投稿: 993 参加年月日: 07/04/27 最新の投稿
Hi,

For the JNDI resource jdbc/LiferayPool, if you prefer to use the pooling mechanism provided by the portal application server you can still do that through spring. In particular add this to the ext-spring.xml file:

<bean id="liferayDataSource"
class="org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy">
<property name="targetDataSource">
<bean
class="com.liferay.portal.spring.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="jdbc/LiferayPool" />
</bean>
</property>
</bean>

Thanks

Jonas Yuan
thumbnail
15年前 に Lisa Simpson によって更新されました。

RE: Database Configuration Changed in 5.2

Liferay Legend 投稿: 2034 参加年月日: 09/03/05 最新の投稿
Make sure that you also edit the server.xml to show that it is using MySQL (or whatever) instead of the defaults.
15年前 に Suresh Damodaran によって更新されました。

RE: Database Configuration Changed in 5.2

New Member 投稿: 3 参加年月日: 09/03/06 最新の投稿
Jonas Yuan:
Hi,

For the JNDI resource jdbc/LiferayPool, if you prefer to use the pooling mechanism provided by the portal application server you can still do that through spring. In particular add this to the ext-spring.xml file:

<bean id="liferayDataSource"
class="org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy">
<property name="targetDataSource">
<bean
class="com.liferay.portal.spring.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="jdbc/LiferayPool" />
</bean>
</property>
</bean>

Thanks

Jonas Yuan


Where should ext-spring.xml be placed? In the EXT environment, I see it @ ext-impl/src/META-INF, but I don't know where it will go in the deployed environment, in case I wantto manually place it in the deployment environment. I do see portal-impl.jar (/META-INF) having some spring configurations - is that where it goes? Also, I am supposing you do this after setting
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/portaldb?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=
jdbc.default.password=

Thanks
thumbnail
15年前 に Jonas Yuan によって更新されました。

RE: Database Configuration Changed in 5.2

Liferay Master 投稿: 993 参加年月日: 07/04/27 最新の投稿
Hi,

It is here

{liferay-home}\{tomcat}\webapps\ROOT\WEB-INF\classes

and

{liferay-home}\{tomcat}\webapps\ROOT\WEB-INF\classes\META-INF

Thanks

Jonas Yuan