cancel
Showing results for 
Search instead for 
Did you mean: 

Migration from Windows to Linux

kbryd
Champ in-the-making
Champ in-the-making
Hello

I have encountered on interesting problem. I have Alfresco running on Windows system ('production' system), sometimes I have to work on this repository and I copy it form that Windows box to my Linux system (no risk destroying production system). And this is where problem starts, when I copy MySQL database over to Linux box (MySQL version is the same) and start Alfresco I get this in the log:

13:48:54,734 ERROR [org.alfresco.repo.domain.schema.SchemaBootstrap] Schema auto-update failed
org.alfresco.error.AlfrescoRuntimeException: A previous schema upgrade failed or was not completed.  Revert to the original database before attempting the upgrade again.
        at org.alfresco.repo.domain.schema.SchemaBootstrap.onBootstrap(SchemaBootstrap.java:1136)
        at org.alfresco.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:62)
        at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:77)
        at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:75)
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:246)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:355)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
        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:525)
        at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926)
        at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:889)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at org.apache.catalina.core.StandardService.start(StandardService.java:516)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
        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:597)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
13:48:54,735 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.alfresco.error.AlfrescoRuntimeException: Schema auto-update failed
        at org.alfresco.repo.domain.schema.SchemaBootstrap.onBootstrap(SchemaBootstrap.java:1192)
        at org.alfresco.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:62)
        at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:77)
        at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:75)
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:246)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:355)


Sometimes messages are more cryptic:

13:05:32,371 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Schema managed by database dialect org.hibernate.dialect.MySQLInnoDBDialect.
13:05:33,226 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Executing database script /tmp/acme/tomcat/temp/Alfresco/AlfrescoSchemaUpdate-org.hibernate.dialect.MySQLInnoDBDialect-4382784727159994799.sql (Generated).
13:05:35,614 ERROR [org.alfresco.repo.domain.schema.SchemaBootstrap] Statement execution failed:
   SQL: alter table JBPM_ACTION add index FK_ACTION_REFACT (REFERENCEDACTION_), add constraint FK_ACTION_REFACT foreign key (REFERENCEDACTION_) references JBPM_ACTION (ID_)
   Error: Can't create table './alfresco/#sql-123a_ac.frm' (errno: 121)
   File: /tmp/acme/tomcat/temp/Alfresco/AlfrescoSchemaUpdate-org.hibernate.dialect.MySQLInnoDBDialect-4382784727159994799.sql
   Line: 29
13:05:35,614 ERROR [org.alfresco.repo.domain.schema.SchemaBootstrap] Schema auto-update failed
java.sql.SQLException: Can't create table './alfresco/#sql-123a_ac.frm' (errno: 121)
It works only when I manually disable schema update.

When I start the same Alfresco backup on a Windows box then it works just fine (and with schema update=true!). When I copy working Alfresco from Linux to Windows then there are also no issues…

Anyone can explain it?

Thanks
Karol
6 REPLIES 6

pmonks
Star Contributor
Star Contributor
From the symptoms listed above it's hard to be sure what the problem is, but my first suspicion is that you're running different binary builds of Alfresco on each environment.

Cheers,
Peter

kbryd
Champ in-the-making
Champ in-the-making
Hello Peter

No, I copy whole Alfresco directory from Windows to Linux (except jdk and Open Office obviously) , then I do chmod +x tomcat/bin/* and start it as usual (I am using alfresco.sh form a Linux Alfresco installation because in Windows one there are only *.bat files).

I am using Alfresco Labs 3.0 Stable (exact version string is Alfresco started (Labs): Current version 3.0.0 (Stable 1526) schema 1002 - Installed version 3.0.0 (Stable 1526) schema 1002), could it be that the default MySQL configuration on Linux is different and not compatible with Windows?

Karol

mike54
Champ in-the-making
Champ in-the-making
I'm trying to do the same thing and I get the same error.
My current server is WIndows with Alfresco 3.2 and destination server is CentOS 5.3 with Alfresco 3.2
At the beginning I had Windows 3.0 and Centos 3.2 - but I have upgraded (with schema update) so that both systems run 3.2…

Centos version still wants to perform schema update and fails with:
e JBPM_ACTION add index FK_ACTION_REFACT (REFERENCEDACTION_), add constraint FK_ACTION_REFACT foreign key (REFERENCEDACTION_) references JBPM_ACTION (ID_)
   Error: Can't create table './alfresco/#sql-2c04_d8.frm' (errno: 121)
   File: /usr/share/tomcat5/temp/Alfresco/AlfrescoSchema-MySQLInnoDBDialect-Update-40094.sql
   Line: 29
20:32:35,291 ERROR [org.alfresco.repo.domain.schema.SchemaBootstrap] Schema auto-update failed
java.sql.SQLException: Can't create table './alfresco/#sql-2c04_d8.frm' (errno: 121)

One more thing is that I don't know if the DB update was actually sucessful?
On the windowsmachine I can see:
18:42:38,738 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco started (Community): Current version 3.2.0 (2039) schema 2019 - Installed version 3.0.0 (c 1342) schema 1000

I'm not sure if I understand - current version is 3.2 and installed versin is 3.0…?

Any sugestions please? Smiley Happy

norgan
Champ in-the-making
Champ in-the-making
That sounds like a bug, one of you should open an "support request" issue with issues.alfresco.com and post the link here so others can vote on it and add their comments.

mike54
Champ in-the-making
Champ in-the-making
OK, I know what was causing this problem!
I'm totally new to Linux / CentOS and it took me some time before I have realized, why it wants to perform schema update…?
I was thinking - what is different between those systems? In my case the answer was.. case sensitivity!
Migrated database was not "recognized" by alfresco under linux and it wanted to perform schema update that failed for the same reason.

I have added this option to MySQL server config file (my.cnf): lower_case_table_names=1

This resulted in a pretty looking clean log with only one warning that I still have to cope with, that is OpenOffice connection…

Regards,
Maciej

zomurn
Champ in-the-making
Champ in-the-making
Mike54 > nice quote ! You gain one point to save me days of research Smiley Wink. (unfortunately I can't because it is not a reply from you…Smiley Sad )