Combination View Flat View Tree View
Threads [ Previous | Next ]
Christophe Schutz
[Database migration] Liferay's UpgradeProcess
April 19, 2012 8:10 AM
Answer

Christophe Schutz

Rank: New Member

Posts: 8

Join Date: February 27, 2012

Recent Posts

Hello everyone,

we've been running into a problem today. We had to change the server on which the database was hosted, so basically we did copy all the data of the Liferay's installation (lportal database) and a custom database, each defined as a Resource in Tomcat to be usable by the portal and the apps in it.

Problem is, when we try to start up the Tomcat with Liferay in it, Liferay goes through it's UpgradeProcess even though there should be nothing to upgrade since it's a database copy which used to work. Here's a printstacktrace (translated from french) :

  115:52:20,484 INFO  [UpgradeProcess:108] Upgrading com.liferay.portal.upgrade.UpgradeProcess_6_0_6
  215:52:20,484 INFO  [UpgradeProcess:108] Upgrading com.liferay.portal.upgrade.v6_0_6.UpgradeSchema
  315:52:20,500 WARN  [BaseDB:376] ORA-01430: the column already exists in the table: alter table JournalArticleResource add uuid_ VARCHAR(75) null;
  415:52:20,515 WARN  [BaseDB:376] ORA-00955: this object already exists: create table SocialEquityGroupSetting (    equityGroupSettingId LONG not null primary key,    groupId LONG,    companyId LONG,    classNameId LONG,    type_ INTEGER,    enabled BOOLEAN);
  515:52:20,515 INFO  [UpgradeProcess:108] Upgrading com.liferay.portal.upgrade.v6_0_6.UpgradeRSS
  615:52:20,578 ERROR [JDBCExceptionReporter:101] ORA-01453: SET TRANSACTION must be the first instruction of the transaction
  7
  815:52:20,578 ERROR [MainServlet:202] com.liferay.portal.kernel.events.ActionException: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.QueryTimeoutException: could not load an entity: [com.liferay.counter.model.impl.CounterImpl#com.liferay.counter.model.Counter]
  9com.liferay.portal.kernel.events.ActionException: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.QueryTimeoutException: could not load an entity: [com.liferay.counter.model.impl.CounterImpl#com.liferay.counter.model.Counter]
 10    at com.liferay.portal.events.StartupAction.run(StartupAction.java:53)
 11    at com.liferay.portal.servlet.MainServlet.processStartupEvents(MainServlet.java:1166)
 12    at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:199)
 13    at javax.servlet.GenericServlet.init(GenericServlet.java:212)
 14    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
 15    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
 16    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421)
 17    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4734)
 18    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
 19    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
 20    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
 21    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:675)
 22    at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:601)
 23    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
 24    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
 25    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
 26    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
 27    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
 28    at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
 29    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
 30    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
 31    at org.apache.catalina.core.StandardService.start(StandardService.java:525)
 32    at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
 33    at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
 34    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 35    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 36    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 37    at java.lang.reflect.Method.invoke(Method.java:597)
 38    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
 39    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
 40Caused by: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.QueryTimeoutException: could not load an entity: [com.liferay.counter.model.impl.CounterImpl#com.liferay.counter.model.Counter]
 41    at com.liferay.portal.service.persistence.impl.BasePersistenceImpl.processException(BasePersistenceImpl.java:195)
 42    at com.liferay.counter.service.persistence.CounterFinderImpl._obtainIncrement(CounterFinderImpl.java:388)
 43    at com.liferay.counter.service.persistence.CounterFinderImpl.createCounterRegister(CounterFinderImpl.java:225)
 44    at com.liferay.counter.service.persistence.CounterFinderImpl.createCounterRegister(CounterFinderImpl.java:177)
 45    at com.liferay.counter.service.persistence.CounterFinderImpl.getCounterRegister(CounterFinderImpl.java:252)
 46    at com.liferay.counter.service.persistence.CounterFinderImpl.increment(CounterFinderImpl.java:96)
 47    at com.liferay.counter.service.persistence.CounterFinderImpl.increment(CounterFinderImpl.java:88)
 48    at com.liferay.counter.service.persistence.CounterFinderImpl.increment(CounterFinderImpl.java:84)
 49    at com.liferay.counter.service.impl.CounterLocalServiceImpl.increment(CounterLocalServiceImpl.java:41)
 50    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 51    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 52    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 53    at java.lang.reflect.Method.invoke(Method.java:597)
 54    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
 55    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
 56    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
 57    at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:82)
 58    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
 59    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
 60    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
 61    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
 62    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
 63    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
 64    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
 65    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
 66    at $Proxy97.increment(Unknown Source)
 67    at com.liferay.portal.service.impl.ClassNameLocalServiceImpl.addClassName(ClassNameLocalServiceImpl.java:37)
 68    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 69    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 70    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 71    at java.lang.reflect.Method.invoke(Method.java:597)
 72    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
 73    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
 74    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
 75    at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:82)
 76    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
 77    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
 78    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
 79    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
 80    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
 81    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
 82    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
 83    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
 84    at $Proxy14.addClassName(Unknown Source)
 85    at com.liferay.portal.service.impl.ClassNameLocalServiceImpl.getClassName(ClassNameLocalServiceImpl.java:85)
 86    at com.liferay.portal.service.impl.ClassNameLocalServiceImpl.checkClassNames(ClassNameLocalServiceImpl.java:61)
 87    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 88    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 89    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 90    at java.lang.reflect.Method.invoke(Method.java:597)
 91    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
 92    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
 93    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
 94    at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:82)
 95    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
 96    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
 97    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
 98    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
 99    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
100    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
101    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
102    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
103    at $Proxy14.checkClassNames(Unknown Source)
104    at com.liferay.portal.service.ClassNameLocalServiceUtil.checkClassNames(ClassNameLocalServiceUtil.java:236)
105    at com.liferay.portal.tools.DBUpgrader.upgrade(DBUpgrader.java:102)
106    at com.liferay.portal.events.StartupAction.doRun(StartupAction.java:117)
107    at com.liferay.portal.events.StartupAction.run(StartupAction.java:47)
108    ... 29 more
109Caused by: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.QueryTimeoutException: could not load an entity: [com.liferay.counter.model.impl.CounterImpl#com.liferay.counter.model.Counter]
110    at com.liferay.portal.dao.orm.hibernate.ExceptionTranslator.translate(ExceptionTranslator.java:30)
111    at com.liferay.portal.dao.orm.hibernate.SessionImpl.get(SessionImpl.java:135)
112    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
113    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
114    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
115    at java.lang.reflect.Method.invoke(Method.java:597)
116    at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:54)
117    at $Proxy234.get(Unknown Source)
118    at com.liferay.counter.service.persistence.CounterFinderImpl._obtainIncrement(CounterFinderImpl.java:366)
119    ... 94 more
120Caused by: org.hibernate.QueryTimeoutException: could not load an entity: [com.liferay.counter.model.impl.CounterImpl#com.liferay.counter.model.Counter]
121    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:124)
122    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
123    at org.hibernate.loader.Loader.loadEntity(Loader.java:1937)
124    at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:86)
125    at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:76)
126    at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3270)
127    at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:496)
128    at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:477)
129    at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:227)
130    at org.hibernate.event.def.DefaultLoadEventListener.lockAndLoad(DefaultLoadEventListener.java:403)
131    at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:155)
132    at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1080)
133    at org.hibernate.impl.SessionImpl.get(SessionImpl.java:1065)
134    at org.hibernate.impl.SessionImpl.get(SessionImpl.java:1056)
135    at com.liferay.portal.dao.orm.hibernate.SessionImpl.get(SessionImpl.java:131)
136    ... 101 more
137Caused by: java.sql.SQLException: ORA-01453: SET TRANSACTION doit être la première instruction de la transaction
138
139    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
140    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
141    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
142    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
143    at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:210)
144    at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:961)
145    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1190)
146    at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1726)
147    at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1696)
148    at oracle.jdbc.driver.PhysicalConnection.setTransactionIsolation(PhysicalConnection.java:1697)
149    at org.apache.tomcat.dbcp.dbcp.DelegatingConnection.setTransactionIsolation(DelegatingConnection.java:380)
150    at org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.setTransactionIsolation(PoolingDataSource.java:343)
151    at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocationHandler.getTargetConnection(LazyConnectionDataSourceProxy.java:414)
152    at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocationHandler.invoke(LazyConnectionDataSourceProxy.java:376)
153    at $Proxy4.prepareStatement(Unknown Source)
154    at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:534)
155    at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:452)
156    at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
157    at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1596)
158    at org.hibernate.loader.Loader.doQuery(Loader.java:717)
159    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:270)
160    at org.hibernate.loader.Loader.loadEntity(Loader.java:1933)
161    ... 113 more
162Stopping the server due to unexpected startup errors


Is there any way to force Liferay not to go trough this UpgradeProcess ? Does

We run on Liferay 6.0.6 on a Tomcat 6.

Thank you in advance,

Chris
David H Nebinger
RE: [Database migration] Liferay's UpgradeProcess
April 19, 2012 8:58 AM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 7466

Join Date: September 1, 2006

Recent Posts

Check the value in the release_ table (only one row). It should match the version you're using, if it's not there or not the same, the upgrade process is invoked.
Christophe Schutz
RE: [Database migration] Liferay's UpgradeProcess
April 20, 2012 1:47 AM
Answer

Christophe Schutz

Rank: New Member

Posts: 8

Join Date: February 27, 2012

Recent Posts

Hello, thank you for your quick answer.

Unfortunately, I did check the value for this single-lined table, and it is strictly the same on both servers :

RELEASEID : 1
CREATEDATE : 26/09/2011 15:52:33,000000
MODIFIEDDATA : 19/04/2012 08:15:52,187000
SERVLETCONTEXTNAME : portal
BUILDNUMBER : 6006
BUILDDATE : 19/04/2012 08:15:52,187000
VERIFIED : 1
TESTSTRING : You take the blue pill, the story ends, you wake up in your bed and believe whatever you want to believe. You take the red pill, you stay in Wonderland, and I show you how deep the rabbit hole goes.


So the problem has to be elsewhere..

EDIT : On another server we migrated, the problem is somewhat different (probably related though) : Liferay boots correctly but displays the default Liferay page, just like none of our custom themes/portlets were deployed (life a fresh install). Moving back to the old server IP, our site appears again. Are there any steps for a database migration other than copying the database and setting the new jdbc resources in server.xml of Tomcat ?
David H Nebinger
RE: [Database migration] Liferay's UpgradeProcess
April 20, 2012 5:34 AM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 7466

Join Date: September 1, 2006

Recent Posts

Well, there's possibly some settings in portal-ext.properties file that may have been set up, but not normally using named IP addresses.

Do you have virtual hosts set up?
Hitoshi Ozawa
RE: [Database migration] Liferay's UpgradeProcess
April 22, 2012 7:25 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7954

Join Date: March 23, 2010

Recent Posts

Check your database tables. If your new server hosting database is able to distinguish upper and lower case, it may be the case that there are tables with the same name but one using capital letters and an another will all lower case. Liferay is executing the upgrade process because it's not finding the copied tables and recreating them.

I've seen this happen in MySQL when importing database from Windows to Linux. In this case, you'll just have to set my.cnf to only use lowercase table names.
Christophe Schutz
RE: [Database migration] Liferay's UpgradeProcess
April 24, 2012 2:02 AM
Answer

Christophe Schutz

Rank: New Member

Posts: 8

Join Date: February 27, 2012

Recent Posts

Hello,

I finally fixed the problem and it had nothing to do with Liferay, we created a dump of our database and the script that imported it into the new one contained errors.

Sorry for wasting your time, and thank you for your help anyways !

Chris
Hitoshi Ozawa
RE: [Database migration] Liferay's UpgradeProcess
April 24, 2012 5:02 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7954

Join Date: March 23, 2010

Recent Posts

So the cause of the problem was really that not all data were being imported into the new database. That'll do what you've mentioned. Glad to hear that you've got it working now. emoticon