Message Boards

Liferay Database migration from 6.2 to Liferay DXP

thumbnail
reeshu patel, modified 6 Years ago.

Liferay Database migration from 6.2 to Liferay DXP

New Member Posts: 4 Join Date: 7/16/13 Recent Posts
Required Tools and software:
1) JDK-8
2) DXPSetup (See http://www.liferaysolution.com/2016/09/liferay-dxp-setup.html )
3) Liferay 6.X Up and running Database
4) Document Library files from 6.X
5) Keep backup of Database as well as data folder of 6.X

Steps to perform for database migration from 6.X to DXP :
1) If you already have install DXP in local machine then you would have one package called portal-tools-db-upgrade-client available inside \liferay-workspace\bundles\tools\portal-tools-db-upgrade-client path.

2) Open app-server.propertiesfile and un-comment below entry

dir=../../tomcat-8.0.32
global.lib.dir=lib
portal.dir=webapps/ROOT
server.detector.server.id=tomcat


3) Open portal-upgrade-database.properties and un-comment below entry for 6.X DB detail

jdbc.default.url=jdbc:oracle:thin:@localhost:1521:xe
jdbc.default.driverClassName=oracle.jdbc.OracleDriver
jdbc.default.username=LIFERAY71
jdbc.default.password=testpassword


4) Open portal-upgrade-ext.properties.properties and put below property to point Liferay DXP bundle path

liferay.home=C:/Jigs-DXP/liferay-developerstudio/workspace/Jigs_DXP_WS/bundles

module.framework.base.dir=D:/Ingram/Ingarm_Liferay7/liferay-ce-portal-7.0-ga3/osgi


5) Go to liferay-workspace\bundles\osgi\configs and create one config file called

com.liferay.portal.search.configuration.IndexStatusManagerConfiguration.cfg
and put below property inside that :
indexReadOnly=true


6) Go to \liferay-workspace\bundles\tools\portal-tools-db-upgrade-client and run below command to execute upgrade process:

java -jar com.liferay.portal.tools.db.upgrade.client.jar -j "-Duser.country=US -Duser.language=en -Duser.timezone=GMT -Xmx4096m"


Note: Check user table manually and get default user id, default user id should not have null friendly URL in GROUP_ table.
Prashant Sharma, modified 6 Years ago.

RE: Liferay Database migration from 6.2 to Liferay DXP

New Member Posts: 24 Join Date: 7/14/14 Recent Posts
Hi Reeshu,

I need to migrate from liferay 6.2 ce to Liferay 7.0. (not DXP), can you please guide me with the steps i need to do for complete migration.
Are the steps required for Database migration to Liferay 7.0 same as mentioned for DXP?

Regards
Prashant Sharma
thumbnail
Alberto Chaparro, modified 6 Years ago.

RE: Liferay Database migration from 6.2 to Liferay DXP

Liferay Master Posts: 549 Join Date: 4/25/11 Recent Posts
Hi Prashant,

The steps are the same between 7.0 CE and DXP.

Regards.
thumbnail
Alberto Chaparro, modified 6 Years ago.

RE: Liferay Database migration from 6.2 to Liferay DXP

Liferay Master Posts: 549 Join Date: 4/25/11 Recent Posts
Prashant Sharma, modified 6 Years ago.

RE: Liferay Database migration from 6.2 to Liferay DXP

New Member Posts: 24 Join Date: 7/14/14 Recent Posts
Alberto Chaparro:
Hi Prashant,

The steps are the same between 7.0 CE and DXP.

Regards.


Hi Alberto,
Thanks for your quick response.

Even i was thinking the same. Got little confused as i was unable to find " \liferay-workspace\bundles\tools\portal-tools-db-upgrade-client " tools folder under my Liferay7 workspace (as of eclipse), however it is present under "liferay-ce-portal-7.0-ga5"/tools folder.

So, on a confirmation i can follow above mentioned steps for DB migration Right?

Regards
Prashant Sharma
thumbnail
Alberto Chaparro, modified 6 Years ago.

RE: Liferay Database migration from 6.2 to Liferay DXP

Liferay Master Posts: 549 Join Date: 4/25/11 Recent Posts
That's a misunderstanding, the proper folder is "liferay-ce-portal-7.0-ga5"/tools". You can follow the DB migration steps.

I hope it helps.

Best regards.
Prashant Sharma, modified 6 Years ago.

RE: Liferay Database migration from 6.2 to Liferay DXP

New Member Posts: 24 Join Date: 7/14/14 Recent Posts
Thanks again Alberto.

Regards
Prashant Sharma
thumbnail
tushar verma, modified 4 Years ago.

RE: Liferay Database migration from 6.2 to Liferay DXP

New Member Posts: 5 Join Date: 9/25/12 Recent Posts
Hi , I am facing the same issue during migration from 6.2 DB to 7.2  after upragde process i got same exception in Verfying process :2019-12-10 01:21:43.724 ERROR [main][DBUpgrader:114] Unable to execute verify process: com.liferay.portal.verify.VerifyException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.ConstraintViolationException: could not insert: [com.liferay.portal.model.impl.ResourcePermissionImpl]
com.liferay.portal.verify.VerifyException: com.liferay.portal.verify.VerifyException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.ConstraintViolationException: could not insert: [com.liferay.portal.model.impl.ResourcePermissionImpl]
    at com.liferay.portal.verify.VerifyProcess.verify(VerifyProcess.java:74)
    at com.liferay.portal.verify.VerifyProcessUtil._verifyProcess(VerifyProcessUtil.java:113)
    at com.liferay.portal.verify.VerifyProcessUtil._verifyProcess(VerifyProcessUtil.java:78)
    at com.liferay.portal.verify.VerifyProcessUtil.verifyProcess(VerifyProcessUtil.java:47)
    at com.liferay.portal.events.StartupHelper.verifyProcess(StartupHelper.java:163)
    at com.liferay.portal.events.StartupHelperUtil.verifyProcess(StartupHelperUtil.java:89)
    at com.liferay.portal.tools.DBUpgrader.verify(DBUpgrader.java:246)
    at com.liferay.portal.tools.DBUpgrader.main(DBUpgrader.java:109)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.liferay.portal.tools.db.upgrade.client.DBUpgraderLauncher.main(DBUpgraderLauncher.java:55)
Caused by: com.liferay.portal.verify.VerifyException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.ConstraintViolationException: could not insert: [com.liferay.portal.model.impl.ResourcePermissionImpl]
    at com.liferay.portal.verify.VerifyProcess.verify(VerifyProcess.java:74)
    at com.liferay.portal.verify.VerifyProcess.verify(VerifyProcess.java:90)
    at com.liferay.portal.verify.VerifyProcessSuite.doVerify(VerifyProcessSuite.java:28)
    at com.liferay.portal.verify.VerifyProcess.verify(VerifyProcess.java:71)
    ... 12 more
Caused by: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.ConstraintViolationException: could not insert: [com.liferay.portal.model.impl.ResourcePermissionImpl]
    at com.liferay.portal.dao.orm.hibernate.ExceptionTranslator.translate(ExceptionTranslator.java:39)
    at com.liferay.portal.dao.orm.hibernate.SessionImpl.flush(SessionImpl.java:184)
    at com.liferay.portal.dao.orm.hibernate.SessionFactoryImpl.closeSession(SessionFactoryImpl.java:45)
    at com.liferay.portal.dao.orm.hibernate.VerifySessionFactoryWrapper.closeSession(VerifySessionFactoryWrapper.java:78)
    at com.liferay.portal.kernel.service.persistence.impl.BasePersistenceImpl.closeSession(BasePersistenceImpl.java:106)
    at com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl.addResourcePermissions(ResourcePermissionLocalServiceImpl.java:564)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:50)
    at com.liferay.portal.spring.aop.AopInvocationHandler.invoke(AopInvocationHandler.java:49)
    at com.sun.proxy.$Proxy102.addResourcePermissions(Unknown Source)
    at com.liferay.portal.service.impl.ResourceActionLocalServiceImpl.checkResourceActions(ResourceActionLocalServiceImpl.java:236)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:50)
    at com.liferay.portal.spring.aop.AopInvocationHandler.invoke(AopInvocationHandler.java:49)
    at com.sun.proxy.$Proxy103.checkResourceActions(Unknown Source)
    at com.liferay.portal.kernel.service.ResourceActionLocalServiceUtil.checkResourceActions(ResourceActionLocalServiceUtil.java:72)
    at com.liferay.portal.verify.VerifyPermission.doVerify(VerifyPermission.java:40)
    at com.liferay.portal.verify.VerifyProcess.verify(VerifyProcess.java:71)
    ... 15 more
Caused by: org.hibernate.exception.ConstraintViolationException: could not insert: [com.liferay.portal.model.impl.ResourcePermissionImpl]
    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:96)
    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
    at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2455)
    at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2875)
    at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:79)
    at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)
    at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:265)
    at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:184)
    at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
    at com.liferay.portal.dao.orm.hibernate.event.NestableFlushEventListener.onFlush(NestableFlushEventListener.java:61)
    at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)
    at com.liferay.portal.dao.orm.hibernate.SessionImpl.flush(SessionImpl.java:181)
    ... 37 more
Caused by: java.sql.BatchUpdateException: Duplicate entry '7792001' for key 'PRIMARY'
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at com.mysql.cj.util.Util.handleNewInstance(Util.java:192)
    at com.mysql.cj.util.Util.getInstance(Util.java:167)
    at com.mysql.cj.util.Util.getInstance(Util.java:174)
    at com.mysql.cj.jdbc.exceptions.SQLError.createBatchUpdateException(SQLError.java:224)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchSerially(ClientPreparedStatement.java:853)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchInternal(ClientPreparedStatement.java:435)
    at com.mysql.cj.jdbc.StatementImpl.executeBatch(StatementImpl.java:796)
    at com.zaxxer.hikari.pool.ProxyStatement.executeBatch(ProxyStatement.java:125)
    at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeBatch(HikariProxyPreparedStatement.java)
    at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
    at org.hibernate.jdbc.BatchingBatcher.addToBatch(BatchingBatcher.java:56)
    at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2435)
    ... 46 more
Caused by: java.sql.SQLIntegrityConstraintViolationException: Duplicate entry '7792001' for key 'PRIMARY'
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:117)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
    at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1092)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchSerially(ClientPreparedStatement.java:832)
    ... 53 more
com.liferay.portal.verify.VerifyException: com.liferay.portal.verify.VerifyException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.ConstraintViolationException: could not insert: [com.liferay.portal.model.impl.ResourcePermissionImpl]
    at com.liferay.portal.verify.VerifyProcess.verify(VerifyProcess.java:74)
    at com.liferay.portal.verify.VerifyProcessUtil._verifyProcess(VerifyProcessUtil.java:113)
    at com.liferay.portal.verify.VerifyProcessUtil._verifyProcess(VerifyProcessUtil.java:78)
    at com.liferay.portal.verify.VerifyProcessUtil.verifyProcess(VerifyProcessUtil.java:47)
    at com.liferay.portal.events.StartupHelper.verifyProcess(StartupHelper.java:163)
    at com.liferay.portal.events.StartupHelperUtil.verifyProcess(StartupHelperUtil.java:89)
    at com.liferay.portal.tools.DBUpgrader.verify(DBUpgrader.java:246)
    at com.liferay.portal.tools.DBUpgrader.main(DBUpgrader.java:109)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.liferay.portal.tools.db.upgrade.client.DBUpgraderLauncher.main(DBUpgraderLauncher.java:55)
Caused by: com.liferay.portal.verify.VerifyException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.ConstraintViolationException: could not insert: [com.liferay.portal.model.impl.ResourcePermissionImpl]
    at com.liferay.portal.verify.VerifyProcess.verify(VerifyProcess.java:74)
    at com.liferay.portal.verify.VerifyProcess.verify(VerifyProcess.java:90)
    at com.liferay.portal.verify.VerifyProcessSuite.doVerify(VerifyProcessSuite.java:28)
    at com.liferay.portal.verify.VerifyProcess.verify(VerifyProcess.java:71)
    ... 12 more
Caused by: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.ConstraintViolationException: could not insert: [com.liferay.portal.model.impl.ResourcePermissionImpl]
    at com.liferay.portal.dao.orm.hibernate.ExceptionTranslator.translate(ExceptionTranslator.java:39)
    at com.liferay.portal.dao.orm.hibernate.SessionImpl.flush(SessionImpl.java:184)
    at com.liferay.portal.dao.orm.hibernate.SessionFactoryImpl.closeSession(SessionFactoryImpl.java:45)
    at com.liferay.portal.dao.orm.hibernate.VerifySessionFactoryWrapper.closeSession(VerifySessionFactoryWrapper.java:78)
    at com.liferay.portal.kernel.service.persistence.impl.BasePersistenceImpl.closeSession(BasePersistenceImpl.java:106)
    at com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl.addResourcePermissions(ResourcePermissionLocalServiceImpl.java:564)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:50)
    at com.liferay.portal.spring.aop.AopInvocationHandler.invoke(AopInvocationHandler.java:49)
    at com.sun.proxy.$Proxy102.addResourcePermissions(Unknown Source)
    at com.liferay.portal.service.impl.ResourceActionLocalServiceImpl.checkResourceActions(ResourceActionLocalServiceImpl.java:236)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:50)
    at com.liferay.portal.spring.aop.AopInvocationHandler.invoke(AopInvocationHandler.java:49)
    at com.sun.proxy.$Proxy103.checkResourceActions(Unknown Source)
    at com.liferay.portal.kernel.service.ResourceActionLocalServiceUtil.checkResourceActions(ResourceActionLocalServiceUtil.java:72)
    at com.liferay.portal.verify.VerifyPermission.doVerify(VerifyPermission.java:40)
    at com.liferay.portal.verify.VerifyProcess.verify(VerifyProcess.java:71)
    ... 15 more
Caused by: org.hibernate.exception.ConstraintViolationException: could not insert: [com.liferay.portal.model.impl.ResourcePermissionImpl]
    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:96)
    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
    at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2455)
    at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2875)
    at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:79)
    at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)
    at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:265)
    at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:184)
    at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
    at com.liferay.portal.dao.orm.hibernate.event.NestableFlushEventListener.onFlush(NestableFlushEventListener.java:61)
    at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)
    at com.liferay.portal.dao.orm.hibernate.SessionImpl.flush(SessionImpl.java:181)
    ... 37 more
Caused by: java.sql.BatchUpdateException: Duplicate entry '7792001' for key 'PRIMARY'
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at com.mysql.cj.util.Util.handleNewInstance(Util.java:192)
    at com.mysql.cj.util.Util.getInstance(Util.java:167)
    at com.mysql.cj.util.Util.getInstance(Util.java:174)
    at com.mysql.cj.jdbc.exceptions.SQLError.createBatchUpdateException(SQLError.java:224)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchSerially(ClientPreparedStatement.java:853)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchInternal(ClientPreparedStatement.java:435)
    at com.mysql.cj.jdbc.StatementImpl.executeBatch(StatementImpl.java:796)
    at com.zaxxer.hikari.pool.ProxyStatement.executeBatch(ProxyStatement.java:125)
    at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeBatch(HikariProxyPreparedStatement.java)
    at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
    at org.hibernate.jdbc.BatchingBatcher.addToBatch(BatchingBatcher.java:56)
    at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2435)
    ... 46 more
Caused by: java.sql.SQLIntegrityConstraintViolationException: Duplicate entry '7792001' for key 'PRIMARY'
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:117)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
    at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1092)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchSerially(ClientPreparedStatement.java:832)
    ... 53 more

Could you let me know how I can clean all the permission in DB so that migration will go smooth .