craftcms / cms

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

[5.x]: Upgrade from Craft 4 deletes all text fields #15232

Closed LinneaHarts closed 3 months ago

LinneaHarts commented 3 months ago

What happened?

Description

Upgrading from Craft 4.10.1, following the upgrade path, and all text fields in the CMS are empty

Steps to reproduce

  1. Starting with Craft 4.10.1, rebuild the project config, clear the cache
  2. Upgrade all of the plugins and craft version in composer.json
  3. Run composer update
  4. Set the craft db charsets to utf8mb3, etc. as noted in documentation
  5. Run php craft up
  6. Remove craft db charset settings
  7. Run php craft db/convert-charset
  8. Log in to CMS, and all text fields are empty, including in revisions

Expected behavior

Text fields should have values in them

Actual behavior

All text fields are empty

Craft CMS version

4.10.1 to 5.2.2

PHP version

8.2.18

Operating system and version

Mac

Database type and version

MariaDB

Image driver and version

No response

Installed plugins and versions

- I've tried this with my full list of plugins, and also with an abbreviated list of plugins, and it's still happening, so I don't think it's a plugin problem

Plugins CKEditor 4.1.0 Element API 4.1.0 Mix v1.7.1

Craft 5.2.2

brandonkelly commented 3 months ago

Any chance you can send us your Craft 4 database backup and your Craft 5 composer.json + composer.lock files? If so, please send them to support@craftcms.com and we can look into it from there.

ph1lb4 commented 3 months ago

Hi @brandonkelly we are seeing the same exact issue. All fields in our Entries are gone after upgrade. We had used MariaDB 11.0.2 prior to the upgrade, so we think we can rule out the utf8 change as the issue.

brandonkelly commented 3 months ago

@ph1lb4 Same question to you then. The more the merrier.

brandonkelly commented 3 months ago

This ended up being due to Yii 2.0.50 adding JSON column support for MariaDB – which I totally missed when reviewing the update 🤦 – which conflicted with Craft’s MariaDB/JSON column support.

Just released Craft 5.2.3 which fixes the bug.

cweiper commented 1 month ago

Hi @brandonkelly, I was able to get a fully updated Craft 4 updated to 5.3.4 without issues on my local environment running the steps manually. However, anytime I try to deploy those config/composer changes to our staging site I end up with the above stated issue of empty text fields. However, I have tested doing the update manually on the staging server and had content persist until I deployed the committed config changes which wiped out the text fields again. Any thoughts here? I will send the requested info to support as well.

brandonkelly commented 1 month ago

@cweiper Yeah please send a production database backup, plus the Composer and config/project/ files being deployed.

cweiper commented 1 month ago

@brandonkelly , chatted back and for with Tommy at support and settled on redoing the upgrade, which went smoother this time without any data loss.