craftcms / cms

Build bespoke content experiences with Craft.
https://craftcms.com
Other
3.28k stars 635 forks source link

[4.0.3]: Error to migrate when upgrading from craftcms 3.7.43 #11316

Closed pnpaes closed 2 years ago

pnpaes commented 2 years ago

What happened?

I followed the update process described in the documentation but when I get to the migrate/all then I get an error renaming the columng sourceId to canonicalId (draft and revision tables). Just to test it i made some manual updates in the database and then I got issues in matrixblocks and matrixblocks_owners tables as well. regarding ownerId and sortOrder.

This is the migration error: *** failed to apply m210724_180756_rename_source_cols (time: 0.018s)

rename column sourceId in table {{%drafts}} to canonicalId ...Exception: SQLSTATE[HY000]: General error: 1553 Cannot drop index 'fk_fvlrwoeobeonptleeoovxbfkqllwpmiiyjrj': needed in a foreign key constraint The SQL being executed was: ALTER TABLE drafts CHANGE sourceId canonicalId int(11) DEFAULT NULL (/var/www/html/vendor/yiisoft/yii2/db/Schema.php:676)

Craft CMS version

Craft Pro 4.0.3

PHP version

8.1.6

Operating system and version

Linux 5.10.76-linuxkit

Database type and version

MySQL 10.5.8 (Maria DB)

Image driver and version

Imagick 3.6.0 (ImageMagick 6.9.10-23)

Installed plugins and versions

- Control panel doesn't load now after i tried to migrate. but this is from my composers: "craftcms/cms": "^4.0.0", "craftcms/redactor": "^3.0.0", "nystudio107/craft-cookies": "^4.0.0", "percipioglobal/craft-colour-swatches": "^4.0.5", "spicyweb/craft-embedded-assets": "^3.0.1", "verbb/image-resizer": "3.0.0-beta.1", "verbb/super-table": "3.0.0-beta.1", "vlucas/phpdotenv": "^5.4.0" "yiisoft/yii2-shell": "^2.0.3"

brandonkelly commented 2 years ago

Hi, can you please send a database backup from before the initial failed upgrade, over to support@craftcms.com? Along with your latest Craft 4 Composer files, if possible.

pnpaes commented 2 years ago

@brandonkelly i will do that.

olivierbon commented 2 years ago

Closing as we’re helping you via support.