U4-7598 - Database upgrade to 7.4.0 fails: Invalid object name 'cmsPropertyTypeGroup'

Created by Thomas Morris 22 Dec 2015, 13:40:30 Updated by Dhiren 21 Oct 2016, 09:04:32

What did you do?

  • Added Umbraco 7.4.0-beta via NuGet to an existing project which is on 4.11.8
  • Remove old references and invalid code.
  • Load Umbraco and authorise the upgrade. (got warnings about incompatibilities)
  • Click continue and wait for the upgrade.
  • Get an error stating to look at the logs

--- Adds a bunch of migrations --- 2015-12-22 11:42:28,250 [P10224/D8/T25] INFO Umbraco.Core.Persistence.Migrations.MigrationRunner - Added UPGRADE migration 'EnsureMigrationsTableIdentityIsCorrect' to context 2015-12-22 11:42:28,346 [P10224/D8/T25] INFO Umbraco.Core.Persistence.Migrations.MigrationRunner - Added UPGRADE migration 'AddDataDecimalColumn' to context 2015-12-22 11:42:28,519 [P10224/D8/T25] ERROR Umbraco.Core.Persistence.UmbracoDatabase - Database exception occurred System.Data.SqlClient.SqlException (0x80131904): Invalid object name 'cmsPropertyTypeGroup'.

--- Error --- 2015-12-22 11:42:28,536 [P10224/D8/T25] 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: Invalid object name 'cmsPropertyTypeGroup'.

What did you expect to happen?

  • The database migration to update the tables as required

What actually happened?

  • Invalid object name 'cmsPropertyTypeGroup' when it attempted to add the migration: AddUniqueIdPropertyTypeGroupColumn
  • Prevents the upgrade to v7.4.0 (have been able to get this working for 7.3.4)

Looks to be an issue with this migration... https://github.com/umbraco/Umbraco-CMS/blob/7.4.0/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/AddUniqueIdPropertyTypeGroupColumn.cs

1 Attachments

Download WS_JoeyScandizzo_20160120.zip

Comments

Shannon Deminick 04 Jan 2016, 14:25:07

If you can please zip up your db and send it over, we'll need to see why this is happening. You probably have old corrupt data. (You can assign to be visible by HQ only)


Robert Foster 20 Jan 2016, 07:59:35

@Shandem I have the same thing upgrading from 4.7 to 7.4 (beta 2). If I upgrade from 4.7 to 7.3.5 first it runs fine and then I can upgrade to 7.4.

The problem is that in the 6.0.0 set of upgrades cmsTab is renamed to cmsPropertyTypeGroup (RenameCmsTabTable class) and a few other operations are subsequently performed on the newly named table without incident; however when the 7.4.0 collection of migrations comes along it can't find the new table and AddUniqueIdPropertyTypeGroupColumn errors out.

I'm wondering whether it's a transaction issue somehow? After the exception is thrown the database is left in it's original condition (or so it seems)

Database attached (privately for HQ)


Shannon Deminick 20 Jan 2016, 09:20:00

Thanks for the info, we'll have to look into it. These issues are normally due to the incredible amounts of strange db variations from older versions... we keep finding newer/stranger ones.


Stephan 02 Feb 2016, 16:08:22

Reproduced with @rfoster database. Due to us inserting data in the table directly in the migration. Fixing.


Stephan 02 Feb 2016, 16:36:04

Fixed, and then the upgrade fails on TargetVersionSixZeroOne.UpdatePropertyTypesAndGroups because the PropertyTypeGroupDto class has changed (has a new UniqueID field). Fixing.


Stephan 02 Feb 2016, 16:41:18

Fixed, and then... Fixing.


Stephan 02 Feb 2016, 17:54:30

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

With that PR, I can upgrade @rfoster database. Will try @tmorris.


Stephan 03 Feb 2016, 10:45:26

Worked with @tmorris database. Considering fixed.


Stephan 03 Feb 2016, 10:45:55

Review instructions: not so easy, need to download one of the DB and try to upgrade...


Dhiren 21 Oct 2016, 09:04:32

Hi Shannon, I am getting same error while upgrading from 4.11.10 to 6.0.0. Can you please provide what exact patch needs to install to fix this?

Thanks, Dhiren


Priority: Normal

Type: Bug

State: Fixed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.4.0

Due in version: 7.4.0

Sprint: Sprint 8

Story Points:

Cycle: