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 »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Delete ~60K contacts in group
Pages: [1]

Author Topic: Delete ~60K contacts in group  (Read 810 times)

RicardoDavis

  • I’m new here
  • *
  • Posts: 29
  • Karma: 0
  • CiviCRM version: 4 (yay!)
  • CMS version: 7
  • MySQL version: 5.1
  • PHP version: 5.2
Delete ~60K contacts in group
November 30, 2011, 10:02:04 am
Roughly 60K individual contacts were imported into my organization's database that now need to be removed; thankfully on import they were assigned to their own group.  When I view the contacts in the group and select  the option to delete all of the contacts I get the following error:

Quote
HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.

Being the SQL geek I have decided to just manually "delete" (set the contacts' is_deleted flag to 1) and call it done. 

Quote
UPDATE civicrm_contact C
    INNER JOIN civicrm_group_contact GC ON C.id = GC.contact_id AND GC.group_id = 138
SET
    C.is_deleted = 1
;

It didn't appear that any data in child entities to civicrm_contact needed to be updated.  Is this correct?

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Delete ~60K contacts in group
November 30, 2011, 10:55:27 am
I believe that is correct.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Delete ~60K contacts in group
November 30, 2011, 12:46:01 pm

however if u really dont want the 60K contacts u should do a permanent delete on them rather than just setting "is_deleted" which keeps the contact info and hence increases table size / reduces performance etc

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

RicardoDavis

  • I’m new here
  • *
  • Posts: 29
  • Karma: 0
  • CiviCRM version: 4 (yay!)
  • CMS version: 7
  • MySQL version: 5.1
  • PHP version: 5.2
Re: Delete ~60K contacts in group
December 01, 2011, 07:08:42 am
Lobo, I agree because I do want to remove these records permanently.  That said would performing a DELETE query to remove the contact records then deleting the group from within CiviCRM be the best course of action?

RicardoDavis

  • I’m new here
  • *
  • Posts: 29
  • Karma: 0
  • CiviCRM version: 4 (yay!)
  • CMS version: 7
  • MySQL version: 5.1
  • PHP version: 5.2
Re: Delete ~60K contacts in group
December 06, 2011, 05:23:49 am
I used a DELETE query to remove the contacts' records from the civicrm_group_contacts table then from the CiviCRM Manage Groups page I removed the group.  Case closed.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Delete ~60K contacts in group

This forum was archived on 2017-11-26.