Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mark 4 posts 84 karma points
    Nov 12, 2020 @ 09:59
    Mark
    0

    Upgrade from V7 to V8 databases error

    Hi,

    I'm attempting to upgrade from 7.15.6 to 8.9.1 by following this article: https://our.umbraco.com/documentation/Getting-Started/Setup/Upgrading/migrating-to-v8

    Unfortunately I got this database error:

    The database failed to upgrade. ERROR: The database configuration failed with the following message: The constraint 'cmsMacro_PK_cmsMacro' is being referenced by table 'cmsMacroProperty', foreign key constraint 'cmsMacroProperty_FK_cmsMacroProperty_cmsMacro_id'. Could not drop constraint. See previous errors. Please check log file for additional information (can be found in '/App_Data/Logs/')
    

    Does anyone have a solution for this?

    Thanks

    Mark

  • Marc Goodson 2155 posts 14408 karma points MVP 9x c-trib
    Nov 14, 2020 @ 09:51
    Marc Goodson
    1

    Hi Mark

    Have a look at this healthcheck:

    https://our.umbraco.com/packages/developer-tools/pre-migration-health-checks/

    which you can install before attempting the migration.

    This will flag some of the common issues / anomolies that might cause an issue with the migration.

    Generally speaking, when you have an issue like this, it's usually because a previous migration has not been run during previous upgrades between previous versions of Umbraco, and it may be as simple as the constraint that is preventing the script from dropping the other constraint would have been renamed in a previous migration, but hasn't been.

    What you can do is download a new vanilla latest version of Umbraco 7, and install with a new database and compare the names of the constraint in question to see if they match - if they are different then renaming the constraint in your db (or removing it if it's no longer in the latest schema) before migration should resolve the issue.

    If there are lots of issues like this in your database schema, you can maybe try to run all the migrations again against your database for V7 before attempting the migration, by setting the umbracoConfigurationStatus in the web.config appsettings to be an empty string, it will trigger the upgrade process for V7 (it will attempt to run all of them) - check the details of the umbracoMigration table before and after to see what has been run etc..

    But I'd install the healthcheck first and see what it reports first!

    regards

    Marc

Please Sign in or register to post replies

Write your reply to:

Draft