CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Delete all External IDs?
Pages: [1]

Author Topic: Delete all External IDs?  (Read 309 times)

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Delete all External IDs?
January 26, 2015, 08:17:21 am
I need to clear out the External ID field in my database so that I can use it for another system's import. Is there a safe way to do this? Can I do it direct in the database or do I need to do it through Civi?

Are there multiple tables where it's used or is it just stored in a single area?

Thanks in advance.

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Delete all External IDs?
January 26, 2015, 08:20:18 am
I've done this through MySQL, and so long as you've got binary logging turned off (or are prepared for it to be a bit quirky), there shouldn't be any repercussions on any table but civicrm_contact.

"UPDATE civicrm_contact SET external_identifier = NULL" should do it.

This is also a reminder to finish my half-done extension designed to let you change the value of a single field of a found record to the same thing...
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: Delete all External IDs?
January 26, 2015, 08:27:45 am
thanks jon...sorry for my stupidity but you mean turn off binary logging? is that just an issue with local install or I should do that on my production db too? or are you talking about something else...

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Delete all External IDs?
January 26, 2015, 08:49:43 am
I meant that if you have binary logging enabled, your change log won't reflect a change made directly via MySQL, and so will be inaccurate.  It shouldn't have any other effect, but there's a lot I don't know about binary logging.
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Delete all External IDs?

This forum was archived on 2017-11-26.