Confluence Update from 3.5.7 to 4.0: Database mirgration fails

I tried to update to 4.0 but in several tries I always end up in a failure like this. The first try ended up in "Contraint already exits: Bandana ..." So I did a revert to the old installation. Try #2 and #3 ended in a migration issue too (every time a different one raised).

Is this a known issue? At the moment I cannot find a hint in the documentation.

[atlassian.confluence.upgrade.UpgradeLauncherServletContextListener] contextInitialized Upgrade failed, application will not start: Upgrade task com.atlassian.confluence.upgrade.upgradetask.ContentPermissionConstraintsUpgradeTask@6f4ea4a2 failed during the SCHEMA_UPGRADE phase due to: StatementCallback; bad SQL grammar [alter table CONTENT_PERM alter column CPS_ID set not null, add constraint cp_unique_user unique (CPS_ID, CP_TYPE, USERNAME), add constraint cp_unique_group unique (CPS_ID, CP_TYPE, GROUPNAME)]; nested exception is org.postgresql.util.PSQLException: FEHLER: Relation »cp_unique_user« existiert bereits

4 answers

1 accepted

There is a known issue for SQL Server that causes upgrades to fail due to some exisitng database constraints. The bug is outlined here:

CONF-23193

The provided SQL queries in the workaround should allow you to complete your upgrade:

alter table CONTENT_PERM drop constraint cp_unique_user;
  alter table CONTENT_PERM drop constraint cp_unique_group;

Since your upgrade failed, you'll still need to roll back to your backup before running the queries.

Hi,
executing the given commands solved the issue. Confluence 4 is running. :) thx.

Nevertheless I had to execute an additional command:

alter table CONTENT_PERM_SET drop constraint cps_unique_type;

That sounds you are hitting this new bug CONF-23248. The current workaround is to run the following SQL queries before you re-run the upgrade:

delete from CONTENT_PERM where CPS_ID is null;
delete from CONTENT_PERM_SET where CONTENT_ID is null;

Hi,
I tried these queries too, but postgress reported that none rows were affected. Thx anyways for the quick response. :)

We're running into the same Problem upgrading from 3.5.9. After the first failure we thought it might be a good idea to upgrade to 3.5.13 first an then going to 4.0. But the error allready occures when trying to upgrade from 3.5.9 to 3.5.13.

I can post the full log if it helps as there are some more errors in the eventlog

Regards

Steffen

I had this bandana problems too.

What solved my problem is:

1. Do an upgrade from 3.5.7 to 3.5.9

2. Run the SQLs

alter table CONTENT_PERM drop constraint cp_unique_user;
alter table CONTENT_PERM drop constraint cp_unique_group;
alter table CONTENT_PERM_SET drop constraint cps_unique_type;

3. Do the upgrade to 4.0

Regards,

Mezza


					
				
			
			
			
				

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

774 views 23 12
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you