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) »
  • Remove users from group accidentally added?
Pages: [1]

Author Topic: Remove users from group accidentally added?  (Read 1120 times)

chris.mccreery

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: 3.1
  • CMS version: Standalone
  • MySQL version: 5.1
  • PHP version: 5.2
Remove users from group accidentally added?
March 22, 2011, 10:28:37 am
A user has accidentally added thousands of users to a group. I can see when they were added and was wondering if I can search based on this criteria and then remove all the users from the group? For example I know these users were all added on March 20th, 2011.

Thanks in advance

ctarascio

  • I post frequently
  • ***
  • Posts: 334
  • Karma: 30
    • American Friends Service Committee
  • CiviCRM version: 4.1.3
  • CMS version: Drupal 6.26
  • MySQL version: 5.5.20
  • PHP version: 5.3.13
Re: Remove users from group accidentally added?
March 22, 2011, 10:52:05 am
hi chris,
you can use the advanced search to zero in on the records you want to remove: check the box for the appropriate group and then, in the "change log" section, specify the date and, if you have the username name, enter it as well. when the results are presented be sure to verify that only those records that you want to remove are listed. once you are sure, click on "all xxx records" and select "delete contacts" from the drop-down menu.

just take care and it should work out OK.

hope this helps,
cynthia

chris.mccreery

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: 3.1
  • CMS version: Standalone
  • MySQL version: 5.1
  • PHP version: 5.2
Re: Remove users from group accidentally added?
March 22, 2011, 11:12:36 am
Will this only remove them from the Group or delete the contacts altogether?

ctarascio

  • I post frequently
  • ***
  • Posts: 334
  • Karma: 30
    • American Friends Service Committee
  • CiviCRM version: 4.1.3
  • CMS version: Drupal 6.26
  • MySQL version: 5.5.20
  • PHP version: 5.3.13
Re: Remove users from group accidentally added?
March 22, 2011, 11:22:39 am
Oops! i apologize chris, for the careless response. what i suggested would delete the contacts entirely. instructions are modified accordingly:

you can use the advanced search to zero in on the records you want to remove from the group: check the box for the appropriate group and then, in the "change log" section, specify the date and, if you have the username name, enter it as well. when the results are presented be sure to verify that only those records that you want to remove are listed. once you are sure, click on "all xxx records" and select "remove from group" from the drop-down menu.

i believe this will accomplish what you want to do.

cynthia

chris.mccreery

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: 3.1
  • CMS version: Standalone
  • MySQL version: 5.1
  • PHP version: 5.2
Re: Remove users from group accidentally added?
March 22, 2011, 11:35:52 am
Hmmm when I check a contact in the list I can see "Modified by admin on March 20th, 2011"

When I perform the advanced search per your instructions I get no results.

No matches found for:
Contact Type - 'Individual' or 'Household' or 'Organization' ...AND...
Member of Group IN Aboriginal Summit - Attendees ...AND...
Group Status - "Added" ...AND...
Modified Date - greater than or equal to "March 20th, 2011 12:00 AM" ...AND...
Modified Date - less than or equal to "March 20th, 2011 11:59 PM"

Seems weird.

chris.mccreery

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: 3.1
  • CMS version: Standalone
  • MySQL version: 5.1
  • PHP version: 5.2
Re: Remove users from group accidentally added?
March 22, 2011, 11:42:34 am
If I view the Changelog for the individual user there is nothing listed. But when I view the Groups tab this is where I see the user was Added (by admin) March 20th, 2011.

ctarascio

  • I post frequently
  • ***
  • Posts: 334
  • Karma: 30
    • American Friends Service Committee
  • CiviCRM version: 4.1.3
  • CMS version: Drupal 6.26
  • MySQL version: 5.5.20
  • PHP version: 5.3.13
Re: Remove users from group accidentally added?
March 22, 2011, 11:54:56 am
chris,
were the thousands of records that were added to the group already in civi or were they new records? if they were already in civi that might explain why the search is not working as "modified date" would not change just by virtue of adding someone to a group.

i am not familiar with your system so i can't be specific as to what the search criteria should be, but i think if you play around with it you will hopefully be able to isolate the records you want to remove from the group.

other than being added to the same group, was there anything "unique" about the records that were added?

cynthia

chris.mccreery

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: 3.1
  • CMS version: Standalone
  • MySQL version: 5.1
  • PHP version: 5.2
Re: Remove users from group accidentally added?
March 22, 2011, 11:58:51 am
Thanks Cynthia.

These were all users within CiviCRM. I am trying to determine the steps the user took to add these to the list but I'm thinking they may have selected all contacts in CiviCRM and hit Add to Group my mistake. So I'm not sure if I can find a unique field for these users in order to remove them from the group. Any other suggestions? Thanks again.

ctarascio

  • I post frequently
  • ***
  • Posts: 334
  • Karma: 30
    • American Friends Service Committee
  • CiviCRM version: 4.1.3
  • CMS version: Drupal 6.26
  • MySQL version: 5.5.20
  • PHP version: 5.3.13
Re: Remove users from group accidentally added?
March 22, 2011, 12:07:01 pm
chris,
i'm not a "coder" so this is just my opinion. short of using a sql query that examines "group date added" (for example), i don't see how you can isolate the records unless there is something unique about them. if you aren't familiar with sql it might be easier to restore from a backup if there wasn't a lot of work done after the records were added.

i'm hoping someone more technical is monitoring this thread and can offer you some better advice.

sorry i can't be more helpful and i hope you can eventually rectify the issue,
cynthia

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: Remove users from group accidentally added?
March 22, 2011, 12:57:49 pm

if they were a static group, the easiest thing to do might be to go into mysql and:

1. Delete the "wrongly added" records from civicrm_group_contact

2. Might also want to clean up the records from civicrm_subscription_history

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

chris.mccreery

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: 3.1
  • CMS version: Standalone
  • MySQL version: 5.1
  • PHP version: 5.2
Re: Remove users from group accidentally added?
March 22, 2011, 01:06:09 pm
Not super comfy with sql queries. But since all the users were added to the group would they now all have the same "added on" date? How could I differentiate between the members that originally belonged to the group?

Thanks,

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Remove users from group accidentally added?

This forum was archived on 2017-11-26.