Hi all,
I'm facing an issue when trying to upgrade from 4.2 to 5.2 Alfresco version. Following this steps: https://docs.alfresco.com/content-services/5.2/upgrade/#upgrading-alfresco-content-services. Hope someone can help me here.
Everything works fine and I'm able to restore preproduction data (SQL Server), but when I try to restore production data it constantly fails...
Steps I follow:
- Stop tomcat
- Restore database and contentstore
- Remove indexes
- Start tomcat
The first problem appears at first startup after database restoration:
2022-02-07 12:57:34,937 ERROR [org.alfresco.repo.domain.schema.SchemaBootstrap] [localhost-startStop-1] Schema auto-update failed
org.alfresco.error.AlfrescoRuntimeException: 01070000
More than one Alfresco schema was found when querying the database metadata.
Limit the database user's permissions or set the 'hibernate.default_schema' property in 'custom-hibernate-dialect.properties'.
As I have several Alfresco instances in my DB, I set that property in my alfresco-global.properties like this:
hibernate.default_schema=ALFRESCO_DB_NAME
and restart (I've tried even deleting and restoring the database), but another error is shown:
2022-02-07 14:08:40,953 ERROR [org.alfresco.repo.domain.schema.SchemaBootstrap] [localhost-startStop-1] Statement execution failed:
SQL: CREATE TABLE alf_applied_patch
(
id NVARCHAR(64) NOT NULL,
description NVARCHAR(1024),
fixes_from_schema INT,
fixes_to_schema INT,
applied_to_schema INT,
target_schema INT,
applied_on_date DATETIME,
applied_to_server NVARCHAR(64),
was_executed TINYINT,
succeeded TINYINT,
report NVARCHAR(1024),
PRIMARY KEY (id)
)
Error: There is already an object named 'alf_applied_patch' in the database.
File: C:\ALFRES~1\tomcat\temp\Alfresco\AlfrescoSchema-AlfrescoSQLServerDialect-Update-7872876674921456678.sql
Line: 24
2022-02-07 14:08:40,953 ERROR [org.alfresco.repo.domain.schema.SchemaBootstrap] [localhost-startStop-1] Schema auto-update failed
com.microsoft.sqlserver.jdbc.SQLServerException: There is already an object named 'alf_applied_patch' in the database.
First thing I've discovered: no matter what I set in hibernate.default_schema, it always shows this error. Maybe it's not the name of the database what I have to declare here?
The thing is that when Alfresco makes the validation schema at startup, doesn't found any table, as it shows in the log written in the temp file:
Difference: missing table from database, expected at path: dbo.alf_access_control_entry
Difference: missing table from database, expected at path: dbo.alf_access_control_list
Difference: missing table from database, expected at path: dbo.alf_ace_context
Difference: missing table from database, expected at path: dbo.alf_acl_change_set
Difference: missing table from database, expected at path: dbo.alf_acl_member
Difference: missing table from database, expected at path: dbo.alf_activity_feed
Difference: missing table from database, expected at path: dbo.alf_activity_feed_control
Difference: missing table from database, expected at path: dbo.alf_activity_post
Difference: missing table from database, expected at path: dbo.alf_applied_patch
It seems that alfresco doesn't find the database to validate the schema but it does find it when it tries to create the tables.
I'm absolutely lost with this, hope someone can help me . Thank you very much in advance 