The upgrade should not change your table encoding.
In your wp-config.php, what are your DB Charset and Collation set to? They usually look like this:
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
/** Database Charset to use in creating database tables. */
define( ‘DB_CHARSET’, ‘utf8’ );
/** The Database Collate type. Don’t change this if in doubt. */
define( ‘DB_COLLATE’, ” );
It’s exactly the same.
I opened Adminer and I see that in my tables appears latin_swedish_ci WHICH SEEMS IT WAS THE DEFAULT while in worpress tables appears utf8mb4_unicode_ci.
This may be my fault. So this must be the problem?
Nevertheless , I do not undersand why the update of WordPress copies my data to the tables again, because definetely the data was right before the update to 5.4.
-
This reply was modified 4 years, 1 month ago by capbussat.
This stems from changes made in 2015 actually
https://make.ww.wp.xz.cn/core/2015/04/02/the-utf8mb4-upgrade/ explains a lot of it, but the tl;dr is that your site should have auto-updated the database stuff for you back with WP 4.2 (yeah, I know).
We saw a few sites have this problem back then, though I’ve not seen any since 5.0.
Try changing your settings to this:
define('DB_CHARSET', '');
define('DB_COLLATE', '');
Yes, blank ’em both out. See if that works.
If so, my guess is that your test site just recently met the requirements and tried to upgrade.
I suppose DB_CHARSET applies only to new database tables? So, in this case it will not change the tables anyway.
Thanks.
It won’t change existing tables, no.