Plugin Maintenance errors with 'Duplicate key value supplied' when loading

Problem

Loading the plugin Maintenance form may produce the error 'Duplicate key value supplied' when loading a plugin.



Cause

This is often caused when opening the Legacy Pre Version 7 plugin after upgrading a version 6 database to version 7. 

If there are custom fields with unique identifiers which are not unique across multiple custom field tables, then this error will occur.

Solution

Run the attached SQL Script to identify which custom fields have duplicate values for their unique identifiers.

Duplicates will need to have SQL scripts crafted to manually set the unique identifiers to be a new, unique value.  The attached SQL Script also shows and example of this.