3.5.13 to 5.0.3 Upgrade fails on "Duplicate key name like_cid_idx"
Asked by Peter Eisenschmidt:

Hello there,

I was doing an upgrade on confluence. But I stuck on a specific part.

First I show you which steps I am doing:  

We have a new and an old server. On the old server runs that instance that needs to be upgraded. On the new server I am testing the upgrade

- setup a clean 3.4.8 linux standalone on the testserver  
- migrate the confluence-data folder from the old server to the testserver   
- full db dump of the old server (mysql)  
- migrate the db to the new server  
- edit settings on the new server (DB settings and confluence data)  
- start 3.4.8.  
- wait, see if it's ok  
- shut it down  

- setup a clean 3.5.13 linux standalone on the testserver  
- edit the settings to work with the db and confluence-home  
- start 3.5.13  
- wait, see if it's ok  
- shut it down  

- start the 5.0.3 bin for linux  
- use default settings  
- install with sudo  
- wait for start  
- error occurs in the log  

```
ERROR [main] [atlassian.confluence.upgrade.UpgradeLauncherServletContextListener] contextInitialized Upgrade failed, application will not start: Upgrade task com.atlassian.confluence.upgrade.upgradetask.LikesSqlConstraintsUpgradeTask@32c6dd3d failed during the UPGRADE phase due to: StatementCallback; bad SQL grammar [create index like_cid_idx on LIKES (CONTENTID)]; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Duplicate key name 'like_cid_idx'
```


Answers:
author: Steve Gerstner [bridgingIT]
body: You should first migrate to 4.3 and after that to 5.x

comments: author: Peter Eisenschmidt
body: I guess not, because the documentation told me to move to 3.5. then 5.0.3  
See here: [Upgrading Confluence](https://confluence.atlassian.com/display/DOC/Upgrading+Confluence)


author: Steve Gerstner [bridgingIT]
body: I'm not sure, where I have read it, but you have to go to 5.2 and then I think even on 5.3 to come to 5.4.

And every question here asking for your topic says, from 3.5 to 4.3 and then to 5. Take a look an this discussion: <https://answers.atlassian.com/questions/234876/recommended-upgrade-path-confluence-3-4-5-3>


author: Peter Eisenschmidt
body: But discussions seem to differ from the documentation. I guess a confluence supporter needs to join this conversation.

Edit: I also need to mention that I temporarly solved that problem with deleting the "LIKES" table in the db. But still I am not sure why this problem occurs. I've redone that process several times and it always occurs.


author: Steve Gerstner [bridgingIT]
body: Try it with 4.3, that worked for me. And I have done this several times too ;)


author: Peter Eisenschmidt
body: I am doing what you suggest - but even here this error occurs. And again it can be resolved manually by deleting the table LIKES.

I am doing the same as mentioned on top, just 4.3.7 added in between.

So its now this way:

3.4.8 -\> 3.5.13 -\> 4.3.7 -\> 5.0.3 -\> 5.4.2

I have to drop the table LIKES at version 4.3.7


author: Steve Gerstner [bridgingIT]
body: there should be no talbe called likes when migrating fom 3.5 to 4.3 because the like feature is one of confluence 4.

Can you please verify that the table is not present in 3.4 and 3.5?


author: Peter Eisenschmidt
body: I have accepted and upvoted your answer. Thank you for helping out on this bug/problem.

I can confirm that this table does not exist on 3.4.8  
I did not check the 3.5.13. But I will do it and edit this post.


Tags: confluence-administration

upgrade