AnsweredAssumed Answered

Migrating from 4.0b (MySQL) to 5.0b (Postgres)

Question asked by dnaumer on Nov 23, 2015
Hello AlfrescoBoard,

for about two weeks now, I am trying to update and migrate (sometimes at the same time) Alfresco.

The situation is: I got Alfresco 4.0b running on MySQL on server A (CentOS). I want to migrate that Alfresco (let's say 5.0, but more about that a little later) to server B, running Postgres and Debian.

I've used every tutorial IN THE BOOK. I tried alfrescos migration documentation. Everything worked about ok. So migrating from 4.0b to 4.0b (mysql to postgres) worked just fine. But upgrading even to 4.0e crashes.

For transfering the database I used pgloader. Everything works just fine as long as I don't update. But if I do I get every error I had in this forum. And none of the solutions actually fit my situation.

So, my state of mind is desperate. I got everything ready for all your ideas to test immediately. In this state, I'm ok with upgrading to 4.0e (which goes wrong -> Bootstrap failed) or to 5.0x (which also fails with Context initialization failed). At some point I even had duplicate private key problems. Because of my desperation, I just deleted the entries to "remove" those errors.

What I do every time: I install Alfresco (whatever version). I stop it from the installer. Then I set the hostname in alfresco-global.properties and turn indexing off. I start postgresql and import the dump from the pgloader (which is generated on another server). I stop postgres, move the contentstore and contentstore.deleted to alf_data and start alfresco again and stop it. Then I turn the indexing on again, and start alfresco one last time. And now the errors rain down on me.

If you need any error report or log, I will gladly send one. If you have any more questions about my servers and there configuration, feel free to ask. I'm stuck.

Here's an error I get after doing the said procedure in Alfresco 4.0e.

10:13:07,613 INFO  [org.alfresco.repo.admin.patch.PatchExecuter] Checking for patches to apply …
10:13:07,877 INFO  [org.alfresco.repo.admin.patch.PatchExecuter]    Applying patch 'patch.imapSpacesTemplates2' (Replaces content templates for IMAP clients).
10:13:20,771 ERROR [org.alfresco.repo.admin.patch.PatchExecuter] 10230039 org.alfresco.error.AlfrescoRuntimeException: 10230038 Bootstrap failed
   at org.alfresco.repo.importer.ImporterBootstrap.bootstrap(ImporterBootstrap.java:361)
   at org.alfresco.repo.admin.patch.impl.GenericBootstrapPatch.applyInternal(GenericBootstrapPatch.java:121)
   at org.alfresco.repo.admin.patch.AbstractPatch.applyImpl(AbstractPatch.java:407)
   at org.alfresco.repo.admin.patch.AbstractPatch.access$000(AbstractPatch.java:52)
   at org.alfresco.repo.admin.patch.AbstractPatch$2$1.execute(AbstractPatch.java:466)
   at org.alfresco.repo.admin.patch.AbstractPatch$2$1.execute(AbstractPatch.java:463)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:388)
   at org.alfresco.repo.admin.patch.AbstractPatch$2.doWork(AbstractPatch.java:469)
   at org.alfresco.repo.admin.patch.AbstractPatch$2.doWork(AbstractPatch.java:456)
   at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:519)
   at org.alfresco.repo.admin.patch.AbstractPatch.apply(AbstractPatch.java:478)
   at org.alfresco.repo.admin.patch.PatchServiceImpl$PatchWork.applyPatch(PatchServiceImpl.java:491)
   at org.alfresco.repo.admin.patch.PatchServiceImpl$PatchWork.execute(PatchServiceImpl.java:403)
   at org.alfresco.repo.admin.patch.PatchServiceImpl.applyPatch(PatchServiceImpl.java:258)
   at org.alfresco.repo.admin.patch.PatchServiceImpl.applyPatchAndDependencies(PatchServiceImpl.java:235)
   at org.alfresco.repo.admin.patch.PatchServiceImpl.applyOutstandingPatches(PatchServiceImpl.java:171)
   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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
   at $Proxy93.applyOutstandingPatches(Unknown Source)
   at org.alfresco.repo.admin.patch.PatchExecuter.applyOutstandingPatches(PatchExecuter.java:76)
   at org.alfresco.repo.admin.patch.PatchExecuter$1.doWork(PatchExecuter.java:124)
   at org.alfresco.repo.admin.patch.PatchExecuter$1.doWork(PatchExecuter.java:120)
   at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:519)
   at org.alfresco.repo.admin.patch.PatchExecuter.onBootstrap(PatchExecuter.java:128)
   at org.springframework.extensions.surf.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:56)
   at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEventInternal(SafeApplicationEventMulticaster.java:209)
   at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEvent(SafeApplicationEventMulticaster.java:180)
   at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303)
   at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:911)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:428)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
   at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:63)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
   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.deployWAR(HostConfig.java:905)
   at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500)
   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:597)
   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: org.alfresco.service.cmr.view.ImporterException: Failed to import package at line 23; column 18 due to error: Duplicate child name not allowed: emailbody_textplain_share.ftl
   at org.alfresco.repo.importer.view.ViewParser.parse(ViewParser.java:194)
   at org.alfresco.repo.importer.ImporterComponent.parserImport(ImporterComponent.java:414)
   at org.alfresco.repo.importer.ImporterComponent.importView(ImporterComponent.java:263)
   at org.alfresco.repo.importer.ImporterBootstrap.doImport(ImporterBootstrap.java:479)
   at org.alfresco.repo.importer.ImporterBootstrap.access$000(ImporterBootstrap.java:70)
   at org.alfresco.repo.importer.ImporterBootstrap$1$1.execute(ImporterBootstrap.java:350)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:388)
   at org.alfresco.repo.importer.ImporterBootstrap$1.doWork(ImporterBootstrap.java:354)
   at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:519)
   at org.alfresco.repo.importer.ImporterBootstrap.bootstrap(ImporterBootstrap.java:357)
   … 65 more
Caused by: org.alfresco.service.cmr.repository.DuplicateChildNodeNameException: Duplicate child name not allowed: emailbody_textplain_share.ftl
   at org.alfresco.repo.domain.node.AbstractNodeDAOImpl$3.execute(AbstractNodeDAOImpl.java:2809)
   at org.alfresco.repo.domain.node.AbstractNodeDAOImpl$3.execute(AbstractNodeDAOImpl.java:2783)
   at org.alfresco.ibatis.RetryingCallbackHelper.doWithRetry(RetryingCallbackHelper.java:101)
   at org.alfresco.repo.domain.node.AbstractNodeDAOImpl.newChildAssocImpl(AbstractNodeDAOImpl.java:2817)
   at org.alfresco.repo.domain.node.AbstractNodeDAOImpl.newNode(AbstractNodeDAOImpl.java:1081)
   at org.alfresco.repo.node.db.DbNodeServiceImpl.createNode(DbNodeServiceImpl.java:361)
   at sun.reflect.GeneratedMethodAccessor288.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
   at org.alfresco.repo.tenant.MultiTNodeServiceInterceptor.invoke(MultiTNodeServiceInterceptor.java:104)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
   at $Proxy8.createNode(Unknown Source)
   at sun.reflect.GeneratedMethodAccessor288.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.alfresco.repo.service.StoreRedirectorProxyFactory$RedirectorInvocationHandler.invoke(StoreRedirectorProxyFactory.java:215)
   at $Proxy9.createNode(Unknown Source)
   at org.alfresco.repo.node.MLPropertyInterceptor.invoke(MLPropertyInterceptor.java:278)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.alfresco.repo.node.NodeRefPropertyMethodInterceptor.invoke(NodeRefPropertyMethodInterceptor.java:183)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.alfresco.repo.node.NodeRefPropertyMethodInterceptor.invoke(NodeRefPropertyMethodInterceptor.java:183)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
   at $Proxy8.createNode(Unknown Source)
   at sun.reflect.GeneratedMethodAccessor288.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
   at org.alfresco.repo.audit.DisableAuditableBehaviourInterceptor.invoke(DisableAuditableBehaviourInterceptor.java:113)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:46)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:147)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.alfresco.repo.transaction.RetryingTransactionInterceptor$1.execute(RetryingTransactionInterceptor.java:69)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:388)
   at org.alfresco.repo.transaction.RetryingTransactionInterceptor.invoke(RetryingTransactionInterceptor.java:59)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
   at $Proxy8.createNode(Unknown Source)
   at org.alfresco.repo.importer.ImporterComponent$NodeImporter$CreateNewNodeImporterStrategy.importNode(ImporterComponent.java:1382)
   at org.alfresco.repo.importer.ImporterComponent$NodeImporter.importNode(ImporterComponent.java:608)
   at org.alfresco.repo.importer.view.ViewParser.importNode(ViewParser.java:919)
   at org.alfresco.repo.importer.view.ViewParser.processEndType(ViewParser.java:883)
   at org.alfresco.repo.importer.view.ViewParser.processEndElement(ViewParser.java:863)
   at org.alfresco.repo.importer.view.ViewParser.parse(ViewParser.java:182)
   … 74 more
Caused by: org.springframework.dao.DuplicateKeyException:
### Error updating database.  Cause: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "alf_child_assoc_pkey"
  Detail: Key (id)=(780) already exists.

Outcomes