AnsweredAssumed Answered

[Résolu] migration alfresco de 3.4.d vers une 4.2.c

Question asked by jeanjot on Dec 21, 2012
Latest reply on Feb 7, 2013 by jeanjot
Bonsoir

Je suis en cours de migration sur Alfresco d'une version 3.4.d vers une 4.2.c et je rencontre un problème.

Voici la procédure appliquée :
Serveur Alfresco-3.4.c
1. sauvegarde de la base de données postgresql d'alfresco-3.4.d, avec la commande suivante :
pg_dump -i -h ${host} -p {port} -U ${user} ${base} -C –inserts –file #{tarfile}
2.. sauvegarde du alf_data d'alfresco-3.4.d, dans un fichier tar.gz

Serveur alfresco-4.2.c
3. Installation d'alfresco community version 4.2.c
4. Paramétrage de lucene dans le alfresco-global.properties (pour rester identique au serveur source)
5. Lancement à vide d'alfresco pour validation de l'installation avec une série de test de création et de chargement de fichier.
6. Suppression de la base de données et suppression du contentstore du alf_data
7. reprise du alfresco-global.properties d'alfresco 3.4.d et modification des informations spécifiques à la version 4.2.c, notamment libreofice, lucene (avec reindexation FULL) et autres…
8. copie du contenu du alf_data du afresco-3.4.d dans le alf_data du alfresco 4.2.c
9. restauration de la base de données postgresql du alfresco-3.4.d dans le postgresql d'Alfresco-4.2.c, avec la commande suivante :
./psql -U postgres -h #{host} –dbname template0 < bddPostGresql_alfresco34d.sql
10. test d'accès à la base de données via l'utilisateur de la base de données (OK)
Et enfin
11. Lancement du alfresco-4.2.c

Malheureusement cela ne passe pas.
Lors du premier démarrage nous constatons l'erreur suivante :
16:01:19,930 ERROR [org.alfresco.repo.domain.schema.SchemaBootstrap] Statement execution failed:
   SQL: ALTER TABLE alf_node_assoc
    DROP CONSTRAINT fk_alf_nass_snode
   Error: ERROR: constraint "fk_alf_nass_snode" of relation "alf_node_assoc" does not exist

Je vous laisse ensuite le détail :
16:00:38,841 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Connecting to database: jdbc:postgresql://localhost:5432/alfresco42c, UserName=alfresco, PostgreSQL Native Driver
16:00:38,845 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Schema managed by database dialect org.hibernate.dialect.PostgreSQLDialect.
16:00:46,880 WARN  [org.alfresco.repo.domain.schema.SchemaBootstrap] Schema validation found 97 potential problems, results written to: /opt/alfresco-4.2.c/tomcat/temp/Alfresco/Alfresco-Pos
tgreSQLDialect-Validation-Pre-Upgrade-alf_-8215349905763169577.txt
16:00:47,628 WARN  [org.alfresco.repo.domain.schema.SchemaBootstrap] Schema validation found 28 potential problems, results written to: /opt/alfresco-4.2.c/tomcat/temp/Alfresco/Alfresco-Pos
tgreSQLDialect-Validation-Pre-Upgrade-avm_-8862131944888727728.txt
16:00:51,067 WARN  [org.alfresco.repo.domain.schema.SchemaBootstrap] Schema validation found 88 potential problems, results written to: /opt/alfresco-4.2.c/tomcat/temp/Alfresco/Alfresco-Pos
tgreSQLDialect-Validation-Pre-Upgrade-jbpm_-3372859258141500327.txt
16:00:51,104 WARN  [org.alfresco.repo.domain.schema.SchemaBootstrap] Schema validation found 20 potential problems, results written to: /opt/alfresco-4.2.c/tomcat/temp/Alfresco/Alfresco-Pos
tgreSQLDialect-Validation-Pre-Upgrade-act_-7596919530413201375.txt
16:01:05,971 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Normalized schema dumped to file /opt/alfresco-4.2.c/tomcat/temp/Alfresco/Alfresco-schema-PostgreSQLDialect-pre-upgrade-
alf_-8108063028710520909.xml.
16:01:05,972 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Normalized schema dumped to file /opt/alfresco-4.2.c/tomcat/temp/Alfresco/Alfresco-schema-PostgreSQLDialect-pre-upgrade-
avm_-6266718549467791909.xml.
16:01:05,972 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Normalized schema dumped to file /opt/alfresco-4.2.c/tomcat/temp/Alfresco/Alfresco-schema-PostgreSQLDialect-pre-upgrade-
jbpm_-9219971835574173555.xml.
16:01:05,972 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Normalized schema dumped to file /opt/alfresco-4.2.c/tomcat/temp/Alfresco/Alfresco-schema-PostgreSQLDialect-pre-upgrade-
act_-1313117484947878200.xml.
16:01:06,244 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Executing database script /opt/alfresco-4.2.c/tomcat/temp/Alfresco/AlfrescoSchema-PostgreSQLDialect-Update-3335358851450
198097.sql (Copied from classpath:alfresco/dbscripts/upgrade/3.4/org.hibernate.dialect.PostgreSQLDialect/property-unique-ctx-idx.sql).
16:01:06,653 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Executing database script /opt/alfresco-4.2.c/tomcat/temp/Alfresco/AlfrescoSchema-PostgreSQLDialect-Update-6001621068707
606996.sql (Copied from classpath:alfresco/dbscripts/upgrade/3.4/org.hibernate.dialect.PostgreSQLDialect/link-validation-metadata-removing.sql).
16:01:06,728 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Executing database script /opt/alfresco-4.2.c/tomcat/temp/Alfresco/AlfrescoSchema-PostgreSQLDialect-Update-8569542893759
045940.sql (Copied from classpath:alfresco/dbscripts/upgrade/3.4/org.hibernate.dialect.PostgreSQLDialect/AVM-rename-dupes.sql).
16:01:06,969 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Executing database script /opt/alfresco-4.2.c/tomcat/temp/Alfresco/AlfrescoSchema-PostgreSQLDialect-Update-5795613815250
634987.sql (Copied from classpath:alfresco/dbscripts/upgrade/3.4/org.hibernate.dialect.PostgreSQLDialect/varchar-field-sizes-quadruple-increasing.sql).
16:01:07,016 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Executing database script /opt/alfresco-4.2.c/tomcat/temp/Alfresco/AlfrescoSchema-PostgreSQLDialect-Update-7601754738169
071237.sql (Copied from classpath:alfresco/dbscripts/create/org.hibernate.dialect.PostgreSQLDialect/AlfrescoPostCreate-JBPM-FK-indexes.sql).
16:01:17,358 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Executing database script /opt/alfresco-4.2.c/tomcat/temp/Alfresco/AlfrescoSchema-PostgreSQLDialect-Update-3998134687890630120.sql (Copied from classpath:alfresco/dbscripts/upgrade/3.4/org.hibernate.dialect.PostgreSQLDialect/alter-jBPM331-CLOB-columns-to-nvarchar.sql).
16:01:17,411 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Executing database script /opt/alfresco-4.2.c/tomcat/temp/Alfresco/AlfrescoSchema-PostgreSQLDialect-Update-7085099602572825959.sql (Copied from classpath:alfresco/dbscripts/upgrade/3.4/org.hibernate.dialect.PostgreSQLDialect/AVM-index-child-entries-lower.sql).
16:01:18,392 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Executing database script /opt/alfresco-4.2.c/tomcat/temp/Alfresco/AlfrescoSchema-PostgreSQLDialect-Update-2072661987601921237.sql (Copied from classpath:alfresco/dbscripts/create/org.hibernate.dialect.PostgreSQLDialect/AlfrescoPostCreate-JBPM-varinst-indexes.sql).
16:01:18,624 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Executing database script /opt/alfresco-4.2.c/tomcat/temp/Alfresco/AlfrescoSchema-PostgreSQLDialect-Update-2652160126610589438.sql (Copied from classpath:alfresco/dbscripts/upgrade/3.4/org.hibernate.dialect.PostgreSQLDialect/remove-redundant-jbpm-indexes.sql).
16:01:18,746 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Executing database script /opt/alfresco-4.2.c/tomcat/temp/Alfresco/AlfrescoSchema-PostgreSQLDialect-Update-7935331579578209109.sql (Copied from classpath:alfresco/dbscripts/upgrade/4.0/org.hibernate.dialect.PostgreSQLDialect/AclChangeSet-Tracking.sql).
16:01:19,848 INFO  [org.alfresco.repo.domain.schema.SchemaBootstrap] Executing database script /opt/alfresco-4.2.c/tomcat/temp/Alfresco/AlfrescoSchema-PostgreSQLDialect-Update-6627920723547144696.sql (Copied from classpath:alfresco/dbscripts/upgrade/4.0/org.hibernate.dialect.PostgreSQLDialect/NodeAssoc-Ordering.sql).
16:01:19,930 ERROR [org.alfresco.repo.domain.schema.SchemaBootstrap] Statement execution failed:
   SQL: ALTER TABLE alf_node_assoc
    DROP CONSTRAINT fk_alf_nass_snode
   Error: ERROR: constraint "fk_alf_nass_snode" of relation "alf_node_assoc" does not exist
   File: /opt/alfresco-4.2.c/tomcat/temp/Alfresco/AlfrescoSchema-PostgreSQLDialect-Update-6627920723547144696.sql
   Line: 17
16:01:19,931 ERROR [org.alfresco.repo.domain.schema.SchemaBootstrap] Schema auto-update failed
org.postgresql.util.PSQLException: ERROR: constraint "fk_alf_nass_snode" of relation "alf_node_assoc" does not exist
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
       at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:512)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:374)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:366)
        at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
        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:1378)
        at org.alfresco.repo.domain.schema.SchemaBootstrap.executeScriptFile(SchemaBootstrap.java:1328)
        at org.alfresco.repo.domain.schema.SchemaBootstrap.executeScriptUrl(SchemaBootstrap.java:1001)
        at org.alfresco.repo.domain.schema.SchemaBootstrap.checkSchemaPatchScripts(SchemaBootstrap.java:972)
        at org.alfresco.repo.domain.schema.SchemaBootstrap.updateSchema(SchemaBootstrap.java:876)
        at org.alfresco.repo.domain.schema.SchemaBootstrap.onBootstrap(SchemaBootstrap.java:1539)
        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:4791)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:963)
        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1600)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:722)
16:01:19,934 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed

Voilà, si quelqu'un a une idée du problème et pourquoi la migration ne s'effectue pas merci de son retour.

En attendant bonnes fêtes de fin d'année à tous.

Outcomes