I am trying to update our business website from v3.5.1 to v7.1.6 and keep getting the following error:
Exception Caught SQLSTATE: Integrity constraint violation: 1062 Duplicate entry '1-1' for key 'PRIMARY': INSERT INTO `exp_channel_field_groups_fields` (`field_id`, `group_id`) VALUES (1, 1) mysqli_connection.php:122
Anyone have any solutions to get passed this? So far the upgrade got to v3.5.17 and then this exception happened.
Thanks for posting this.
It sounds like you have some bad (duplicate) data in that table.
If you sort that table by “field_id” do you have 2 rows that have field_id set to “1” as well as group_id set to “1”?
If so, I’d recommend backing that table up (always a good idea to backup your whole DB before an upgrade as well).. and delete one of the rows. From there you should be good to go!
Supposedly this table has a column called “channel_id” and then column two is “group_id”. There were 5 duplicates (1-1, 2-2, 3-3, 4-4, 5-5). I removed those and then continued with the installation. The same error came up but this time for (15-9), which doesn’t make any sense. I went as far as removing the whole database and it seems like the upgrade re-installs the duplicates again. Not sure what else to do. This is my first time going through an upgrade like this and kind of crazy that this doesn’t really match the documentation to upgrade from v3.5.1 to v7.1.6.
Any more advice as far as trying to upgrade our EE instance without having to lose data or manually bring in the data into v7?
Few quick questions for you on this front…
Did you get the additional duplicates error after the upgrade was complete? Or was this during the upgrade process?
How many fields do you have in your install?
Any chance you can post a list of add-ons currently in use?
After taking a peek at the code that does this migration of data (part of the 4.0.0 update)… I’m wondering if you might have bad data in your exp_channel_fields table prior to upgrade… If you take a peek at that table, do you see duplicate data for field_id or group_id in there?
Also, how is the upgrade being run? (1 click, manual file drop in)
I know this is a lot of questions… we’re hoping we can get an indication of where things are heading the wrong way.
Sorry for the delayed response.
The upgrade never completed. This error came up during the upgrade process and stopped at 3.5.17 I believe. Here is the table that I have under our table exp_channels_channel_field_groups. As you can see, there are duplicates in both columns. This is for the current install of EE 3 on local that is copying what is in production at the moment.
I even tried deleting this column and the upgrade still added the (1-1, 2-2, etc.) and complains about it. Doesn’t make any sense, but I’m sure there is something that wasn’t setup right to begin with in the previous version that we have.