Existing duplicate code being marked as NEW after migration

Migrated from SonarQube v6.7.4 to v7.9.1.
Migration worked fine and all data was visible on the new server. However after the first scan was ran on v7.9.1, SonarQube marked all existing Duplications as New and failed the quality gate.

What is the reason and how to fix it ? None of the code is really new.

Hello @ankurja,

I can’t be sure from your screenshot but I would guess that the problem comes from the leak period (aka new code period), ie when is the limit between new code and old code, has been changed during the upgrade (possible through an automatic process that “fixed” the previous new code settings that were incorrect (we originally were too permissive, letting users configure incorrect values, leading to random behaviours)
Can you send a screenshot of your project home new code period settings as per below (you should hover on the new code period text to show the tooltip that says when it started)

Hi @OlivierK , here is the screenshot:
I am not concerned about the 1.3K new code smells that show up on the right hand side as those are coming due to varying rules implementation between v6.7.4 and v7.9.1. But the duplication metrics are exact same as you would notice on both left and right hand side.
I also checked that the ‘Leak Period’ shows same date on both old (6.7.4) & new (7.9.1) servers. I believe if the Leak Period had really changed, it would have caused new issues for Bugs, Vulnerabilities and Code smells as well, but that is not the case. Only the duplication matrix has this problem after upgrade.