Rehearsing going from EE2.9.2 -> EE 3.5.16 in this post.
So I have an install with a gigantic site_pages
field in one site’s exp_sites
row. Basically, the Structure add-on hosts thousands and thousands of entry_id-URI
and entry_id-template
data, and Structure uses that field to store that it in the same way the Pages add-on does.
When I take the base64
encoded data directly from the database and unencode it, the result is the appropriate and complete serialized string. It’s huge, but complete. In the EE2 version of this site, the EE2 guts underneath have no problem handling this data.
Now, when I start the upgrade to EE3+, immediately on the initial installer page (with debug = 1
in the system/index.php
file), I get a deserialization error. I can get my EE2 site to upgrade to EE3, but it is clear that even after upgrading, the EE3 guts simply can’t/don’t handle this giant string correctly. My guess is the DB class passes back a truncated base64
string from the database.
I’ve debugged this a bunch. The raw database data for that field will unserialize(base64_decode($that_field_from_that_row_from_that_table))
and be correct, using raw PHP. But I’ve added the same debugging to system/ee/legacy/core/Config.php
(around line 538) and always get a truncated serialized string, which gets passed to unserialize()
which fails because the string in incomplete. The data is definitely there, but EE3 can’t pass it all from the database class (I’m guessing).
I’m not sure what changed underneath with the legacy support, but it seems like the EE3 database class and the EE2 database class have something different between them.
Any thoughts? This is a show stopper and needs to be figured out for me to move on with the upgrade.
Edit
To test this, I use this template with PHP turned on and set to Output on both an EE2 version of the site, and an EE3 version that has been upgraded:
<?php
$site_pages = ee()->db->select('site_pages')->from('sites')->where('site_id', '1')->get()->result_array();
var_dump($site_pages[0]['site_pages']);
?>
The EE2 site dumps a complete base64
encoded string. The EE3 version dumps a truncated string (a little past halfway through). I’ve used a diff to verify both site instances actually have the same raw data for that field in the database.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.