AnsweredAssumed Answered

Problem upgrading from 3.2r to 3.4a on Windows + Postgresql

Question asked by cvillemure on Oct 20, 2010
Latest reply on Nov 1, 2010 by maqsood
Hi,

      I've tried today to upgrade a 3.2r installation to the new 3.4a community edition.

I've followed the upgrade steps described here : http://wiki.alfresco.com/wiki/General_Upgrade_Process

So i've installed the 3.4 with the installer without any problem and everything was working fine.

I've then stopped the service, replaced the database and alf_data with my 3.2r backup and try to restart the service

The first error encountered was the following :


09:03:36,512 INFO  [org.alfresco.config.JndiPropertiesFactoryBean] Loading properties file from class path resource [alfresco/repository.properties]
09:03:36,528 INFO  [org.alfresco.config.JndiPropertiesFactoryBean] Loading properties file from class path resource [alfresco/domain/transaction.properties]
09:03:36,528 INFO  [org.alfresco.config.JndiPropertiesFactoryBean] Loading properties file from file [C:\Borealis\nomDuProjet\Alfresco34a\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\module\test\alfresco-global.properties]
09:03:36,528 INFO  [org.alfresco.config.JndiPropertiesFactoryBean] Loading properties file from file [C:\Borealis\nomDuProjet\Alfresco34a\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\module\tests\alfresco-global.properties]
09:03:36,528 INFO  [org.alfresco.config.JndiPropertiesFactoryBean] Loading properties file from URL [file:/C:/Borealis/nomDuProjet/Alfresco34a/tomcat/shared/classes/alfresco-global.properties]
09:03:36,606 INFO  [org.alfresco.config.JndiPropertyPlaceholderConfigurer] Loading properties file from class path resource [alfresco/alfresco-shared.properties]
09:03:59,395 INFO  [org.springframework.extensions.webscripts.TemplateProcessorRegistry] Registered template processor Repository Template Processor for extension ftl
09:03:59,395 INFO  [org.springframework.extensions.webscripts.ScriptProcessorRegistry] Registered script processor Repository Script Processor for extension js
09:04:10,289 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Schema managed by database dialect org.hibernate.dialect.PostgreSQLDialect.
09:04:15,806 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Executing database script C:\WINDOWS\TEMP\Alfresco\AlfrescoSchema-PostgreSQLDialect-Update-4833463500614607074.sql (Copied from classpath:alfresco/dbscripts/upgrade/3.2/org.hibernate.dialect.PostgreSQLDialect/AlfrescoSchemaUpdate-3.2-ContentTables2.sql).
09:04:15,915 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Executing database script C:\WINDOWS\TEMP\Alfresco\AlfrescoSchema-PostgreSQLDialect-Update-7837465265002177326.sql (Copied from classpath:alfresco/dbscripts/upgrade/3.3/org.hibernate.dialect.PostgreSQLDialect/modify-index-permission_id.sql).
09:04:15,962 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Executing database script C:\WINDOWS\TEMP\Alfresco\AlfrescoSchema-PostgreSQLDialect-Update-7306072689515511718.sql (Copied from classpath:alfresco/dbscripts/upgrade/2.2/org.hibernate.dialect.PostgreSQLDialect/AddFKIndexes.sql).
09:04:18,760 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Executing database script C:\WINDOWS\TEMP\Alfresco\AlfrescoSchema-PostgreSQLDialect-Update-5380972763397163833.sql (Copied from classpath:alfresco/dbscripts/upgrade/3.3/org.hibernate.dialect.PostgreSQLDialect/remove-VersionCount.sql).
09:04:18,760 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Executing database script C:\WINDOWS\TEMP\Alfresco\AlfrescoSchema-PostgreSQLDialect-Update-7104058919245194012.sql (Copied from classpath:alfresco/dbscripts/upgrade/3.3/org.hibernate.dialect.PostgreSQLDialect/fix-Repo-seqs.sql).
09:04:18,807 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Executing database script C:\WINDOWS\TEMP\Alfresco\AlfrescoSchema-PostgreSQLDialect-Update-994888723247639757.sql (Copied from classpath:alfresco/dbscripts/upgrade/3.3/org.hibernate.dialect.PostgreSQLDialect/fix-AVM-seqs.sql).
09:04:18,823 ERROR [org.alfresco.repo.domain.schema.SchemaBootstrap] Statement execution failed:
   SQL: CREATE SEQUENCE avm_stores_seq START WITH 1669 INCREMENT BY 1
   Error: ERROR: relation "avm_stores_seq" already exists
   File: C:\WINDOWS\TEMP\Alfresco\AlfrescoSchema-PostgreSQLDialect-Update-994888723247639757.sql
   Line: 16
09:04:18,823 ERROR [org.alfresco.repo.domain.schema.SchemaBootstrap] Schema auto-update failed
org.postgresql.util.PSQLException: ERROR: relation "avm_stores_seq" already exists
   at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062)
   at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795)
   at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
   at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
   at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353)
   at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:345)
   at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
   at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
   at org.alfresco.repo.domain.schema.SchemaBootstrap.executeStatement(SchemaBootstrap.java:1215)
   at org.alfresco.repo.domain.schema.SchemaBootstrap.executeScriptFile(SchemaBootstrap.java:1165)
   at org.alfresco.repo.domain.schema.SchemaBootstrap.executeScriptUrl(SchemaBootstrap.java:897)
   at org.alfresco.repo.domain.schema.SchemaBootstrap.checkSchemaPatchScripts(SchemaBootstrap.java:868)
   at org.alfresco.repo.domain.schema.SchemaBootstrap.updateSchema(SchemaBootstrap.java:804)
   at org.alfresco.repo.domain.schema.SchemaBootstrap.onBootstrap(SchemaBootstrap.java:1375)
   at org.springframework.extensions.surf.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:56)
   at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97)
   at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEvent(SafeApplicationEventMulticaster.java:78)
   at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:294)
   at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:858)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:419)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:261)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:192)
   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:3972)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467)
   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:443)
   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)
09:04:18,838 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.alfresco.error.AlfrescoRuntimeException: 09200000 Schema auto-update failed
   at org.alfresco.repo.domain.schema.SchemaBootstrap.onBootstrap(SchemaBootstrap.java:1506)
   at org.springframework.extensions.surf.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:56)
   at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97)
   at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEvent(SafeApplicationEventMulticaster.java:78)
   at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:294)
   at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:858)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:419)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:261)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:192)
   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:3972)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467)
   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:443)
   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.postgresql.util.PSQLException: ERROR: relation "avm_stores_seq" already exists
   at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062)
   at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795)
   at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
   at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
   at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353)
   at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:345)
   at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
   at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
   at org.alfresco.repo.domain.schema.SchemaBootstrap.executeStatement(SchemaBootstrap.java:1215)
   at org.alfresco.repo.domain.schema.SchemaBootstrap.executeScriptFile(SchemaBootstrap.java:1165)
   at org.alfresco.repo.domain.schema.SchemaBootstrap.executeScriptUrl(SchemaBootstrap.java:897)
   at org.alfresco.repo.domain.schema.SchemaBootstrap.checkSchemaPatchScripts(SchemaBootstrap.java:868)
   at org.alfresco.repo.domain.schema.SchemaBootstrap.updateSchema(SchemaBootstrap.java:804)
   at org.alfresco.repo.domain.schema.SchemaBootstrap.onBootstrap(SchemaBootstrap.java:1375)
   … 34 more

So I fixed the problematic SQL file : alfresco/dbscripts/upgrade/3.3/org.hibernate.dialect.PostgreSQLDialect/fix-Repo-seqs.sql
by adding "DROP SEQUENCE IF EXISTS …" before each sequence creation.

After that I've restore my 3.2r database backup and tried to upgrade again.

I've encouter many PSQL errors about tenantDomain and then the error log stopped with "context initialization failed nodeRef is a mandatory parameter …"

I've then tried to upgrade Postgresql from 8.2 to 8.4 and start again from step 0 (whitout any modification to the 3.3 sequence creation script).

The avm sequence error popped again, so I've put back my script modification and retry the upgrade process again which then worked.

So if anyone is using Postgresql 8.2, it seems you'll need to upgrade your Postgresql install, in order to upgrade to Alfresco 3.4.  A fresh install is working fine but an upgrade will likely failed.  However, I've been able to do the upgrade process with Postgresql 8.4 then backup the upgraded database with pgAdmin 1.10.5 (version 1.6 had errors in the backup process) and restore it to my 8.2 server then use my Postgresql 8.2 install and Alfresco worked.

I haven't done any exhaustive test yet to check if using Postgresql 8.2 might cause problem.

My questions :

     Does my modification of the SQL script (to add the DROP SEQUENCE directives) is the right thing to do?  Should I've done something else?

      Is there any major issues that i should know if using Postgresql 8.2?

Thanks,

Charles

Outcomes