Fórumok

Back up Restore Issues

Ranendra Das, módosítva 12 év-val korábban

Back up Restore Issues

Regular Member Bejegyzések: 137 Csatlakozás dátuma: 2011.04.06. Legújabb bejegyzések
Hello,

I am facing an issue with backup/restore. I am working on Migration issue from Liferay CE to LIferay EE.

So for that I was trying to do backup, my db is MySQL 5.5, I notices liferay created 370 tables and all tables have duplicated, like, there are 2 users table- User_ and user_ sameway Ticket and ticket.

Now when I do tha backup, it craetes all the tables 2 times with uppercase(1st letter) and lower case, which is fine. I have got 370 tables in my .sql file

Now When I try to restore the DB - it creates only 185 tables and I loose most of my data, it did not restore those tables with uppercase(1st letter).

My Questions are-

1. Why does Liferay creates same table with a uppercase(1st letter ), can't Liferay use the same name table(like user_ instead of new User_). Is the upper case one table View, if its table view then how can I restore it.

2. Is there a better way to migrate - I am doing - 1. backup the db, 2. copy the document_directory folder in new server in proper location. So is this the way to migrate. I can't user importing .lar, it gives exception.

Hope some body will answer my question.

Regards,
Ranendra
thumbnail
David H Nebinger, módosítva 12 év-val korábban

RE: Back up Restore Issues

Liferay Legend Bejegyzések: 14919 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
Ranendra,

MySQL on Linux is case-sensitive with regards to table names, but MySQL on Windows is not case sensitive. Exporting from Windows (which would actually treat the table User_ as user_) and importing into Linux, then running Liferay pointing at the Linux MySQL will result in the duplicate names.

Are you doing export/import across architectures like this?
Pawan Thakur, módosítva 8 év-val korábban

RE: Back up Restore Issues

Junior Member Bejegyzések: 37 Csatlakozás dátuma: 2015.05.11. Legújabb bejegyzések
Hello David,

I am in similar problem.
Windows Environment SQL => Linux Environment SQL creating Duplicate tables when importing like
WikiNode
wikinode
WikiPage
wikipage


Tried workaround from MySQL Websites i.e. setting lower_case_table_names=2 on Windows restarting re importing and exporting the DB and then importing to Linux But No Luck.

Please assist.

Thanks,
Pawan
thumbnail
Olaf Kock, módosítva 8 év-val korábban

RE: Back up Restore Issues

Liferay Legend Bejegyzések: 6403 Csatlakozás dátuma: 2008.09.23. Legújabb bejegyzések
The problem might be the other direction: The tables are created on windows, thus you've lost the upper/lower case table names already.

I haven't tested yet, but it might be a way to use Liferay's own migration tool (in Control Panel/Server Administration/Data Migration) to migrate your current Windows MySQL to a Linux MySQL. If you're lucky, Liferay will create the proper table names (with upper/lower case) on the Linux MySQL while reading from the lower-case Windows database. Otherwise you might want to try writing an ALTER TABLE script where you rename the lowercase tables (on Linux) to their proper case writing, e.g.

ALTER TABLE wikinode rename to WikiNode;
ALTER TABLE wikipage rename to WikiPage;


(naturally it will be quite some work to do this for all table names and I've not tested if this takes care of the associated indexes as well)
thumbnail
Hitoshi Ozawa, módosítva 12 év-val korábban

RE: Back up Restore Issues

Liferay Legend Bejegyzések: 7942 Csatlakozás dátuma: 2010.03.24. Legújabb bejegyzések
I think you had you lower_case_table_names not set to 1 in [mysqld] section in your my.cnf configuration file.
If you're losing your data now, try setting it to 2 to preserve upper/lower case in table names. (this only works if the file system support case sensitive names.)
Ranendra Das, módosítva 12 év-val korábban

MySQLIntegrityConstraintViolationException: Duplicate entry '10131-16249-0'

Regular Member Bejegyzések: 137 Csatlakozás dátuma: 2011.04.06. Legújabb bejegyzések
Hi Guys,

I am trying to migrate from Liferay CE(6.0.6/tomcat 6.0.29 with MySQL 5.1) to LIferay EE(6.0 EE-sp1 /tomcat 6.0.29 with MySQL 5.1).

I took backup from CE application, copied the doc_libarray and images folder and put it in Liferay EE proper location, created a new datasource and dump the data there, then tried to run the application . But getting below error, any idea why am I getting this exception?




com.liferay.portal.servlet.MainServlet.init(MainServlet.java:214) [][main] 
com.liferay.portal.kernel.events.ActionException: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Duplicate entry '10131-16249-0' for key 2
com.liferay.portal.kernel.events.ActionException: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Duplicate entry '10131-16249-0' for key 2
	at com.liferay.portal.events.StartupAction.run(StartupAction.java:52)
	at com.liferay.portal.servlet.MainServlet.processStartupEvents(MainServlet.java:1190)
	at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:211)
	at javax.servlet.GenericServlet.init(GenericServlet.java:212)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4350)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4659)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
	at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
	at org.apache.catalina.core.StandardService.start(StandardService.java:519)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Duplicate entry '10131-16249-0' for key 2
	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:114)
	at com.liferay.portal.upgrade.UpgradeProcessUtil._upgradeProcess(UpgradeProcessUtil.java:80)
	at com.liferay.portal.upgrade.UpgradeProcessUtil.upgradeProcess(UpgradeProcessUtil.java:37)
	at com.liferay.portal.events.StartupHelper.upgradeProcess(StartupHelper.java:73)
	at com.liferay.portal.events.StartupHelperUtil.upgradeProcess(StartupHelperUtil.java:40)
	at com.liferay.portal.tools.DBUpgrader.upgrade(DBUpgrader.java:94)
	at com.liferay.portal.events.StartupAction.doRun(StartupAction.java:116)
	at com.liferay.portal.ee.license.StartupAction.doRun(Unknown Source)
	at com.liferay.portal.events.StartupAction.run(StartupAction.java:46)
	... 29 more
Caused by: com.liferay.portal.kernel.upgrade.UpgradeException: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Duplicate entry '10131-16249-0' for key 2
	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:114)
	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:130)
	at com.liferay.portal.upgrade.UpgradeProcess_6_0_11.doUpgrade(UpgradeProcess_6_0_11.java:34)
	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:111)
	... 37 more
Caused by: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Duplicate entry '10131-16249-0' for key 2
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:931)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
	at com.mysql.jdbc.Connection.execSQL(Connection.java:3250)
	at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1355)
	at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1270)
	at com.mchange.v2.c3p0.impl.NewProxyStatement.executeUpdate(NewProxyStatement.java:64)
	at com.liferay.portal.dao.db.BaseDB.runSQL(BaseDB.java:229)
	at com.liferay.portal.dao.db.BaseDB.runSQL(BaseDB.java:196)
	at com.liferay.portal.dao.db.BaseDB.runSQL(BaseDB.java:183)
	at com.liferay.portal.kernel.upgrade.UpgradeProcess.runSQL(UpgradeProcess.java:80)
	at com.liferay.portal.upgrade.v6_0_11.UpgradeDocumentLibrary.updateFileRanks(UpgradeDocumentLibrary.java:123)
	at com.liferay.portal.upgrade.v6_0_11.UpgradeDocumentLibrary.doUpgrade(UpgradeDocumentLibrary.java:36)
	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:111)
	... 40 more



thumbnail
Hitoshi Ozawa, módosítva 12 év-val korábban

RE: MySQLIntegrityConstraintViolationException: Duplicate entry '10131-1624

Liferay Legend Bejegyzések: 7942 Csatlakozás dátuma: 2010.03.24. Legújabb bejegyzések
I think you should have used data migration (Control Panel - Server Administration - Data Migration) instead of direct database table copy.
If you want to do a direct database operation, I think you'll have to use the whole database instead of just selected tables.
Ranendra Das, módosítva 12 év-val korábban

Migration from Liferay CE to Liferay EE

Regular Member Bejegyzések: 137 Csatlakozás dátuma: 2011.04.06. Legújabb bejegyzések
Here is how to do migrate from Liferay CE 6.0.6 to Liferay EE 6 -

1. Take a backup of CE connected db.

2. Create a new datasource and restore the backup data(from Step 1) to new data source.

3. Unzip a new Liferay CE in a new location.

4. Copy document_library and images folder from the existing Liferay CE to new CE.

5. Modify the portal-ext.properties file in the new Liferay CE folder, connect with the new datasource wheer data has been dumped.

6. Now start the new CE server - its should successfully start and will display the contents properly.

7. Now install Liferay ee somewhere - configure the portal-ext to connect to the newly created the datasource(step 2). Copy the document_library and images folder from Step 4 and start the server. Liferay EE should start successfully.

Thanks