Forum

Welcome to ProjeQtOr new Forum. We migrated old forum to the new website.
You will find all your posts here, with your usual account.
Just one point : you’ll have to reinitialize your password. Use “Lost password” feature.

[SOLVED] Error dupl...
 
Notifications
Clear all

[SOLVED] Error duplicate entry during migration to V10.0.0

5 Posts
2 Users
0 Reactions
1,731 Views
Tony
 Tony
(@tony44)
Posts: 131
Active Member
Topic starter
 
[#8324]

Hello,

I saw the errors below while migrating to V10.0.0 on a test environment.
Did I make a wrong manipulation ?
How to fix the issue ?

2022-06-21 22:16:05.027 ** ERROR ** [V9.5.5] Exception-[23000] SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '215' for key 'PRIMARY'
2022-06-21 22:16:05.031 ** ERROR ** [V9.5.5]    For query : INSERT INTO `modulemenu` (`id`,`idModule`,`idMenu`,`hidden`,`active`) VALUES
(215,32,275,0,0),
(216,32,276,0,0),
(217,32,277,0,0),
(221,32,281,0,0),
(224,31,208,0,(SELECT ms.active FROM  `module` as ms WHERE ms.id=31));
2022-06-21 22:16:05.031 ** ERROR ** [V9.5.5]    Strack trace :
2022-06-21 22:16:05.032 ** ERROR ** [V9.5.5]    #0 Sql->query called at [C:Program Files (x86)EasyPHP-Devserver-17eds-wwwprojeqtordbmaintenanceFunctions.php:72]
2022-06-21 22:16:05.033 ** ERROR ** [V9.5.5]    #1 runScript called at [C:Program Files (x86)EasyPHP-Devserver-17eds-wwwprojeqtordbmaintenance.php:140]
2022-06-21 22:16:05.034 ** ERROR ** [V9.5.5]    #2 include called at [C:Program Files (x86)EasyPHP-Devserver-17eds-wwwprojeqtortoolloginCheck.php:144]
2022-06-21 22:16:05.399 ** ERROR ** [V9.5.5] Exception-[23000] SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '218' for key 'PRIMARY'
2022-06-21 22:16:05.400 ** ERROR ** [V9.5.5]    For query : INSERT INTO `modulemenu` (`id`,`idModule`,`idMenu`,`hidden`,`active`) VALUES
(218,33,278,0,0),
(219,33,279,0,0),
(220,33,280,0,0),
(222,33,282,0,0),
(223,33,283,0,0);
2022-06-21 22:16:05.401 ** ERROR ** [V9.5.5]    Strack trace :
2022-06-21 22:16:05.401 ** ERROR ** [V9.5.5]    #0 Sql->query called at [C:Program Files (x86)EasyPHP-Devserver-17eds-wwwprojeqtordbmaintenanceFunctions.php:72]
2022-06-21 22:16:05.402 ** ERROR ** [V9.5.5]    #1 runScript called at [C:Program Files (x86)EasyPHP-Devserver-17eds-wwwprojeqtordbmaintenance.php:140]
2022-06-21 22:16:05.402 ** ERROR ** [V9.5.5]    #2 include called at [C:Program Files (x86)EasyPHP-Devserver-17eds-wwwprojeqtortoolloginCheck.php:144]

Thanks for your help


Tony44

 
Posted : 22 Jun 2022 1H08
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

Hi,
Either you ran migration twice (but it does not seem to be the case as you should have at least another error before thos one)
or you have some unconsistency in table moduleMenu
Please run query :

select max(id) from modulemenu;

result before migration should be 214
It you have higher value search for duplicates:

select count(id),idModule, idMenu from modulemenu group by idModule, idMenu having count(id)>1;

This query should return no line.
Remove duplicates et change id until max is 214


 
Posted : 22 Jun 2022 11H01
Tony
 Tony
(@tony44)
Posts: 131
Active Member
Topic starter
 

Hi Babynus,

There were indeed duplicates (18), which I deleted.

The table now contains 200 records.
The largest id in this table is now 207: I'm not sure I understood, should this id be replaced by 214 ?

Should the migration to V10.0.0 be restarted and if so, how ?

Thanks again


Tony44

 
Posted : 23 Jun 2022 1H12
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

Hi,
200 records is not enough for V9.5
You should have 207 records (see attached csv)

To finish, if you restored the DB to V9.5, you can replay it after fixing issue on modulemenu table
If you did not restore, check up to where the migration went.
I guess to went correctly up to the end, so if no other error is reported on log file, just check that dbVersion (line of table parameter where parameterCode is 'dbVersion') is correctly set to V10.0.0 and you can envoy the new version.
 


 
Posted : 23 Jun 2022 14H01
Tony
 Tony
(@tony44)
Posts: 131
Active Member
Topic starter
 

Hi,

So I added the missing records according to the csv.
Effectively, 'dbVersion' was indeed set to V10.0.0.
I think everything is in order.

Thanks for the help !


Tony44

 
Posted : 24 Jun 2022 2H19
Share:

Scroll to Top