I’m having some issues doing an upgrade from 2.11 to 3.5. I’m seeing a couple exceptions (one for the admin and one for the index) when I run the updater.
Admin - [screenshot](https://www.dropbox.com/s/nf1a2yvm6r23kz8/Screenshot 2017-05-02 23.34.48.png?dl=0)
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-1' for key 'PRIMARY':
INSERT INTO `exp_layout_publish_member_groups` (`layout_id`, `group_id`) VALUES (1, 1)
mysqli_connection.php:122
Index: [screenshot](https://www.dropbox.com/s/clsq7f0ci62767l/Screenshot 2017-05-02 23.35.33.png?dl=0)
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'can_debug' in 'field list':
SELECT `member_id`, `can_debug`, `admin_sess`, `last_activity`, `fingerprint`, `sess_start`, `login_state` FROM (`exp_sessions`) WHERE `session_id` = '1e32939f0aa601debd88dcf46c9656f291f36613'
mysqli_connection.php:122
I followed the upgrade instructions closely I believe. Not sure what’s going on here. Anyone have any ideas?
The first thing I’d do if I hit a mysql error that stops the upgrade is go look at the config.php file and see what version it shows you currently on. You know the update that’s breaking is the one in the NEXT version.
So if it shows $config[‘app_version’] = ‘3.0.1’; you know it completed all of the stuff in 3.0.1 and the break is happening in the next file.
Then I’d go look at the next file and see exactly what’s failing. If you’re upgrading to v3, that’s in system/ee/installer/updates/- the files are named for the version.
I don’t recognize those errors off hand, so you’d want to know the exact version file before digging in. The layout one may well be a case of some out of sync data- clearly the updater is trying to alter something related to layouts.
You may need to code it to skip over duplicates or some such. In which case, you might need to delete and then add back any layouts that couldn’t be updated. But once you find the code that’s running into a problem, it will be easier to understand the exact cause of the problem.
The can_debug issue happens because a column added in 3_03_00 doesn’t exist. If the current version is later than that, you know something went wrong and things were skipped. At that point, you need to change the version to where you know everything was good and then rerun the update.
If it’s happening BEFORE version 3.03.00, then what I would do is look at up_3_03_00.php, see what the field should look like, and add it manually.
So for me, that query would look something like:
ALTER TABLE exp_sessions ADD COLUMN `can_debug` char(1) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'n'
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.