We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Another EE2 upgrade problem I could use a dev to think/look at

Development and Programming

jonleecraw's avatar
jonleecraw
6 posts
6 years ago
jonleecraw's avatar jonleecraw

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.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.