Xibo Upgrade Error

During the upgrade from 1.4.2 to 1.7.4 we have had this error

An error occurred running the upgrade. Please take a screen shot of this page and seek help. Statement number: 60. Error Message = [SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘1’ for key ‘PRIMARY’]. File = [Array]. SQL = [INSERT INTO transition (TransitionID, Transition, Code, HasDuration, HasDirection, AvailableAsIn, AvailableAsOut) VALUES (1, ‘Fade In’, ‘fadeIn’, 1, 0, 0, 0), (2, ‘Fade Out’, ‘fadeOut’, 1, 0, 0, 0), (3, ‘Fly’, ‘fly’, 1, 1, 0, 0)].

Upgrading from database version 80 to 89

Does anyone know a fix?

tried re-copying the files and it is now this error

An error occurred running the upgrade. Please take a screen shot of this page and seek help. Statement number: 81. Error Message = [SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name ‘moduleSystemFile’]. File = [Array]. SQL = [ALTER TABLE media ADD moduleSystemFile TINYINT NOT NULL DEFAULT ‘0’].

If you are upgrading from 1.4 series then you need to update your CMS to 1.6 series first then to 1.7 series.

List of release notes

1.4 series to 1.6 series upgrade

Then open 1.7 series release notes and update your CMS to 1.7 series.

Thanks for your reply, I was told on a previous post by Alex that I can upgrade directly. I’ve tried installing the earlier version and it gives me this error

Xibo Upgrade
81.sql …

An error occured populating the database.

MySQL Error:
The query [ALTER TABLE media ADD moduleSystemFile TINYINT NOT NULL DEFAULT ‘0’] failed to executeDuplicate column name ‘moduleSystemFile’

SQL executed:
ALTER TABLE media ADD moduleSystemFile TINYINT NOT NULL DEFAULT ‘0’

Statement number: 3

You don’t have to go between versions any more (you did have to before 1.7.4).

I am not sure why your upgrade failed the first time around

This error is likely the second time around failure.

Unfortunately you can’t re-run the upgrade multiple times as the database will be in an unknown state (i.e. it doesn’t know how far it got last time).

Best thing to do is restore your DB backup, run the upgrade again and give us the error from the very first time it failed. We can then manually guide you through getting it upgraded.

OR you could go through 1.6.4 first - which might be easier

Hello! I just installed 1.6 and it worked fine, I took a snapshot at that point. When I went to install the latest version of Xibo I go the error below. I let the upgrade process, it said page cannot be displayed after a few minutes. I refreshed the page and it was back at the upgrade screen.

An error occurred running the upgrade. Please take a screen shot of this page and seek help. Statement number: 81. Error Message = [SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name ‘moduleSystemFile’]. File = [Array]. SQL = [ALTER TABLE media ADD moduleSystemFile TINYINT NOT NULL DEFAULT ‘0’].

I’ve just tried going from my 1.6.4 snapshot to 1.7.0 and gotten this error

An error occurred running the upgrade. Please take a screen shot of this page and seek help. Statement number: 80. Error Message = [SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name ‘render_as’]

Running out of options slightly now. This is after deleting the install.php file as prompted by software.

We had these problems before and it always turned out to be a partial upgrade causing the issue - somehow your 1.6 snapshot has columns in it that it shouldn’t.

You probably want to go from 1.6 to 1.7.4 as we did fix some issues with the upgrade process.

Each time you re-run it gets stuck trying to add a column that shouldn’t be there (that is what the SQL error is telling you).

The file it is stuck on is install/database/80.sql - the statement is the first one in the list that it tried to execute:

ALTER TABLE  `module` ADD  `render_as` VARCHAR( 10 ) NULL;

It fails because it is already there - which means that 80.sql has run before on a past upgrade.

I suspect you don’t have a “clean” 1.4 or 1.6 database any more - unless you took a backup from the original - which means your only option is to go through 80.sql and remove one statement from the top of the list, until it succeeds. Alternatively you could open a paid support case, send us your database and we will go through it and repair it manually for you (which will take some time).

Ok, I’m going to go for a fresh install of Xibo as it seems the best way to go. Is there any way to preserve the Content/Screens?

You should be able to upgrade you 1.4.2 install - although I admit to not testing that route too closely - I am sure you can go from 1.4.2 to 1.6.4 to 1.7.4 without any issues - provided you have a clean experience each time and that your 1.4.2 is a “stock” installation.