Custom Fields not importing into contacts database
Two things:
* "DB Error: constraint violation" isn't enough information to troubleshoot.  If you get an error like this, turn on debugging and backtrace:  Administration menu > System Settings > Debugging and Error Handling.  Posting the debug info and a backtrace greatly increases others' ability to help!
* What you're describing is a known bug:  See here.  Unfortunately, no one who's affected this has stepped up yet with a fix, or funds for the core team to fix it.

To give the usual pitch:  CiviCRM is free to use, but not free to write.  If you're making part of your living from CiviCRM, please consider being part of the community of folks who either fixes bugs or pays people to fix bugs.