cancel
Showing results for 
Search instead for 
Did you mean: 

upgrading to 3.2r

iantopanto
Champ in-the-making
Champ in-the-making
Im having difficulties in upgrading to community edition 3.2r.  When I start the alfresco server it complains that it cannot create a table.
From catalina logs:
11:39:39,452  INFO  [domain.schema.SchemaBootstrap] Executing database script /opt/alfresco/tomcat/temp/Alfresco/AlfrescoSchema-MySQLInnoDBDialect-Update-4834466208350250858.sql (Copied from classpath:alfresco/dbscripts/create/3.2/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoPostCreate-3.2-AuditTables.sql).
11:39:39,470  ERROR [domain.schema.SchemaBootstrap] Statement execution failed:
   SQL: CREATE TABLE alf_audit_app
(
   id BIGINT NOT NULL AUTO_INCREMENT,
   version SMALLINT NOT NULL,
   app_name_id BIGINT NOT NULL,
   audit_model_id BIGINT NOT NULL,
   disabled_paths_id BIGINT NOT NULL,
   CONSTRAINT fk_alf_audit_app_app FOREIGN KEY (app_name_id) REFERENCES alf_prop_value (id),
   CONSTRAINT UNIQUE idx_alf_audit_app_app (app_name_id),
   CONSTRAINT fk_alf_audit_app_model FOREIGN KEY (audit_model_id) REFERENCES alf_audit_model (id) ON DELETE CASCADE,
   CONSTRAINT fk_alf_audit_app_dis FOREIGN KEY (disabled_paths_id) REFERENCES alf_prop_root (id),
   PRIMARY KEY (id)
) ENGINE=InnoDB
   Error: Can't create table './alfresco/alf_audit_app.frm' (errno: 150)
   File: /opt/alfresco/tomcat/temp/Alfresco/AlfrescoSchema-MySQLInnoDBDialect-Update-4834466208350250858.sql
   Line: 32

Table alf_prop_root does not exist therefor it cannot create the foreign key.

Has anyone else experienced this.

Versions before upgrade:
Installed Schema   3001
Installed Version   3.3.0 (2132)
Server Schema   3001
Server Version   3.3.0 (2132)

I was on the community version from Aug 11th before the upgrade and not the 3.2 stable.

Ian
3 REPLIES 3

iantopanto
Champ in-the-making
Champ in-the-making
Corrected that error. 
The problem was that i installed the new version from scratch and copied my alf_data folder and alfresco-global.properties files over and restore my database WITHOUT first running alfresco 3.2r to test that that worked first.  Of course this way the alf_prop_root folder was created first.

NEW PROBLEM:
I installed the new version ok, could use alfresco properly.
I then proceeded to shutdown the new installation, copy my alf_data and properties file, then restored the associated mysqldump of the alfresco database.

Alfresco is trying to run a database upgrade script "alfresco/dbscripts/create/3.2/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoPostCreate-3.2-AuditTables.sql" with the following error.
———-
12:45:08,821  INFO  [domain.schema.SchemaBootstrap] Executing database script /opt/alfresco/tomcat/temp/Alfresco/AlfrescoSchema-MySQLInnoDBDialect-Update-2458076400123009189.sql (Copied from classpath:alfresco/dbscripts/create/3.2/org.hibernate.dialect.MySQLInnoDBDialect/AlfrescoPostCreate-3.2-AuditTables.sql).
12:45:08,823  ERROR [domain.schema.SchemaBootstrap] Statement execution failed:
   SQL: CREATE TABLE alf_audit_model
(
   id BIGINT NOT NULL AUTO_INCREMENT,
   content_data_id BIGINT NOT NULL,
   content_crc BIGINT NOT NULL,
   UNIQUE INDEX idx_alf_audit_cfg_crc (content_crc),
   CONSTRAINT fk_alf_audit_model_cd FOREIGN KEY (content_data_id) REFERENCES alf_content_data (id),
   PRIMARY KEY (id)
) ENGINE=InnoDB
   Error: Table 'alf_audit_model' already exists
   File: /opt/alfresco/tomcat/temp/Alfresco/AlfrescoSchema-MySQLInnoDBDialect-Update-2458076400123009189.sql
   Line: 18
————

iantopanto
Champ in-the-making
Champ in-the-making
I may have missed something along the way to upgrading to this release, but the way I sorted it was by creating a blank alfresco db and restoring my backup over this.  When the database schema upgrade script runs when starting alfresco it creates some audit tables with some foreign keys.  It relies on alf_prop_link  and alf_prop_root  tables which dont exist in my 3.2 installation - so i created these tables.

New version now fires up correctly and has run the schema upgrades properly.

bbukvic
Champ in-the-making
Champ in-the-making
Hello

I have a same problem like you had.
You said that: 'It relies on alf_prop_link and alf_prop_root tables which dont exist in my 3.2 installation - so i created these tables.'

Can you help me and answer me: How?  Smiley Very Happy