Wikis - Page

Knowledge Document: SMG Quarantine Migration Unique Key Error

0 Likes

While migrating from the SMG Appliance to the new RPM based builds, it may occur that a 'duplicate key' error occurs while migrating. The issue is caused by database-constrainting indexes preventing a successful migration of the data.

Labels:

Support Tips/Knowledge Docs
Comment List
  • I have seen this some times; 50 % of my customers have experienced this issue. It is easy to detect. Try to re-index all your databases (4). Re-index will fail if there are duplicate keys.

    In most cases this statement fixed it.

    DELETE FROM public.emailaddress AS A
    USING public.emailaddress AS B
    WHERE A.idemailaddress < B.idemailaddress
    AND A.emailaddress = B.emailaddress;

    However you have to change some settings if it is a different table.

    Therefore here is a second example if table character_set is affected

    DELETE FROM public.character_set AS A
    USING public.character_set AS B
    WHERE A.character_set_id < B.character_set_id
    AND A.characterset = B.characterset;


    Use "Verified Answers" if your problem/issue has been solved!

Related
Recommended