U4-9927 - Upgrading to 7.6.1 fails - missing columns in database

Created by Simon Justesen 17 May 2017, 11:26:25 Updated by Sebastiaan Janssen 06 Jun 2017, 11:32:32

Tags: Backport Unscheduled

Relates to: U4-9993

I've been trying to upgrade an 7.1 installation to 7.6.1. The install fails due to missing columns in the database (checked with a fresh 7.6.1 install)

Solved some of the errors by manually adding these columns to the db: Column: uniqueID, type: uniqueIdentifier, not null in in table UmbracoPropertyTypeGroup Column: typeUniqueId, type: uniqueIdentifier, not null in table UmbracoRelationType:

Now I'm getting this error, which i'm unable to fix: The database failed to upgrade. ERROR: The database configuration failed with the following message: The index 'IX_umbracoNodeUniqueID' is dependent on column 'uniqueID'. ALTER TABLE ALTER COLUMN uniqueID failed because one or more objects access this column.

4 Attachments

Download error.tiff

Comments

Sebastiaan Janssen 17 May 2017, 11:46:40

Would it be possible to send your database using WeTransfer? If so, you can send it to: sj@umbraco.dk


Simon Justesen 17 May 2017, 11:59:20

@sebastiaan Yes, I'll do that right away


Sebastiaan Janssen 17 May 2017, 12:19:45

Cool got it, seems like you might be missing things that were added as early as 6.0.0? Has this site been upgraded from 6.0.0 at least?


Simon Justesen 17 May 2017, 12:40:02

That's kind of weird, because it has never been on the 6.0-branch (we sorta skipped Umbraco 6 because it wouldn't work within the db restrictions of our host at that time, so we stayed on Umbraco4/MySQL until we decided to use MSSQL). We built it on a fresh 7.0 db as far as I can recall.


Sebastiaan Janssen 17 May 2017, 12:41:48

No worries, good to know! Which exact version 7.1 are you on currently please?


Simon Justesen 17 May 2017, 12:44:36

@sebastiaan Good :) Umbraco version 7.1.0 assembly: 1.0.5206.24609


Gareth Pitt-Nash 23 May 2017, 13:28:29

@sebastiaan if it helps, we are having the exact same problem with 7.2.8. Will try scripting the index, dropping & re-creating.


David Sheiles 23 May 2017, 14:55:36

I had the exact same same problem with and upgrade from 7.2.8 as well (Including missing the uniqueID & typeUniqueId columns). As a quick work around I was able to make create a script of the existing [IX_umbracoNodeUniqueID] Index, delete the index, upgrade and then re-create it. No problems yet, but very early days still.


Gareth Pitt-Nash 23 May 2017, 15:07:20

@dinc5150 tried same, but had another error, which said to check the logs in the ...\App_Data\Logs folder, but there was no error logged, the logging level was set to error. Will restore a backup & try again later.


Stephan 31 May 2017, 12:53:48

Confirmed. Cause is: an old migration is using a DTO object to insert some content, but that DTO has been complemented with more columns in a later migration. So when the old migration runs, it tries to write to fields that don't exist (yet). Can be solved by using a temp DTO in the old migration. Looking into it...


Stephan 31 May 2017, 13:49:51

PR https://github.com/umbraco/Umbraco-CMS/pull/1968


Sebastiaan Janssen 31 May 2017, 14:37:19

Good stuff, removed the EnableSqlTrace and merged, this works great now for older sites and also still works for newer upgraders.


Jesse Andrews 05 Jun 2017, 20:45:36

@sebastiaan Did this fix make it into the nuget release for 7.6.3? I'm upgrading a 7.2.8 umbraco site to 7.6.3, but it fails with the following error.

2017-06-05 13:34:14,009 [P4480/D19/T43] ERROR Umbraco.Web.Install.Controllers.InstallApiController - Installation step DatabaseUpgrade failed. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Umbraco.Web.Install.InstallException: The database failed to upgrade. ERROR: The database configuration failed with the following message: The index 'IX_umbracoNodeUniqueID' is dependent on column 'uniqueID'. ALTER TABLE ALTER COLUMN uniqueID failed because one or more objects access this column. }


Brian McNally 05 Jun 2017, 21:02:40

Just curious about this as well. trying to upgrade from 7.1.6 to 7.6.3 and received the following: Error during installation

The database failed to upgrade. ERROR: The database configuration failed with the following message: The index 'IX_umbracoNodeUniqueID' is dependent on column 'uniqueID'. ALTER TABLE ALTER COLUMN uniqueID failed because one or more objects access this column. Please check log file for additional information (can be found in '/App_Data/Logs/UmbracoTraceLog.txt')


Racheal Smith 05 Jun 2017, 23:58:45

Also having this issue. Upgrading from 7.0.1 (assembly: 1.0.5095.27251) to 7.6.3 via NuGet.

Anyone able to offer the following information? -ETA on when this fix will make it into a release. -Latest version that does not have this issue (I assume 7.6.0?)


Stephan 06 Jun 2017, 08:35:12

The fix has been merged into 7.6.3 yes. And tested OK. Which is annoying, because apparently, it was not really a fix. Looking into it & re-opening this issue.


Stephan 06 Jun 2017, 09:43:40

We cannot really reopen this issue as it was due in 7.6.3. Discussion moving over to U4-9993.


Priority: Normal

Type: Bug

State: Fixed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.6.1

Due in version: 7.6.3

Sprint: Sprint 60

Story Points:

Cycle: 2