Errors upgrading XWiki from version 11.10.5 to 14 (Database Schema)

Hi Team,

I’m trying to upgrade xwiki from version 11.10.5 to last version (14) but i’m facing some errors related to the database. My database schema is public, i dont know where is pointing the database name to schema as refered on the errors.

The procedure.

I cloned the production database from to staging environment.

docker run --name xwiki -dti -p 8082:8080 -v xwiki:/usr/local/xwiki -e HTTP_PROXY=http://xxxxx:3128  -e HTTPS_PROXY=xxxxxx  -e DB_USER=xxxxxx -e DB_PASSWORD=xxxxxx -e DB_DATABASE=xwiki_prd -e DB_HOST=xxxxxx -e JAVA_OPTS='-Dhttp.proxyHost=xxxxx -Dhttp.proxyPort=3128 -Dhttps.proxyHost=xxxxx -Dhttps.proxyPort=3128'  xwiki:lts-postgres-tomcat```

**Configurations on hibernate.cfg.xml**

<property name="connection.url">jdbc:postgresql://xxxx:5432/xwiki_prd</property>
 <property name="connection.username">xxxxx</property>
 <property name="connection.password">xxxxxx</property>
 <property name="connection.driver_class">org.postgresql.Driver</property>
 <property name="jdbc.use_streams_for_binary">false</property>
  <property name="xwiki.virtual_mode">schema</property>


Errors:

2023-02-07 13:10:19,553 [jodconverter-offprocmng-0] WARN  tartProcessAndConnectRetryable - Office process died with exit code 81; restarting it
2023-02-07 13:12:12,015 [XWiki initialization] INFO  .HibernateDataMigrationManager - Checking Hibernate mapping and updating schema if needed for wiki [xwiki]
2023-02-07 13:12:12,384 [XWiki initialization] WARN  o.h.e.j.s.SqlExceptionHelper   - SQL Warning Code: 0, SQLState: 00000
2023-02-07 13:12:12,385 [XWiki initialization] WARN  o.h.e.j.s.SqlExceptionHelper   - relation "xwikiattrecyclebin" does not exist, skipping
2023-02-07 13:12:12,387 [XWiki initialization] WARN  o.h.e.j.s.SqlExceptionHelper   - SQL Warning Code: 0, SQLState: 00000
2023-02-07 13:12:12,387 [XWiki initialization] WARN  o.h.e.j.s.SqlExceptionHelper   - relation "xwikiattrecyclebin" does not exist, skipping


**Caused by: org.postgresql.util.PSQLException: ERROR: schema "xwiki_prd" does not exist**
  Position: 14
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2675)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2365)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:355)
        at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:490)
        at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:408)
        at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:329)
        at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:315)
        at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:291)
        at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:286)
        at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:193)
        at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:193)
        at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:54)
        ... 35 common frames omitted
2023-02-07 13:12:15,969 [XWiki initialization] ERROR c.x.x.i.s.h.HibernateStore     - Error executing DDL "create table xwiki_prd.xwikiobjects (XWO_ID int8 not null, XWO_NUMBER int4, XWO_NAME varchar(768) not null, XWO_CLASSNAME varchar(768) not null, XWO_GUID varchar(255), primary key (XWO_ID))" via JDBC Statement
org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL "create table xwiki_prd.xwikiobjects (XWO_ID int8 not null, XWO_NUMBER int4, XWO_NAME varchar(768) not null, XWO_CLASSNAME varchar(768) not null, XWO_GUID varchar(255), primary key (XWO_ID))" via JDBC Statement



Thanks in advance

Did this work with the 11.10.5 docker image? Maybe in 14.x you also get a new postgres version and the upgrade failed in some way there? Just wild guesses of mine.

Thank you @ClemensRobbenhaar.

The solution was upgrade the version of postgres and add a dialect property on hibernate config file.