Answers.Body: <p>If you are confident the users are all there, you could do an import with the CSV dump you mentioned, using the <strong>Group ID</strong> and <strong>Contact ID</strong>. </p>
  
  <p>1) <a href="https://civicrm.stackexchange.com/questions/404/how-do-i-import-75-groups">Batch import the groups</a> using the <a href="https://civicrm.org/extensions/api-csv-import-gui" rel="nofollow">API csv Import</a> module.</p>
  
  <p>2) Assuming the Group IDs could be imported and match up, you could import the users via their internal IDs. Instead of selecting "Group" for the <em>Entity To Import</em> (as in step 1), you can import "GroupContact" and match up the Group ID field and the Contact ID field.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-24T18:14:59.237Z
Answers.Text: Thanks Laryn! Looks promising... I am trying to install it according to this page https://wiki.civicrm.org/confluence/display/CRMDOC42/Extensions , but I am missing the following menu item : Administer » System Settings » Manage CiviCRM Extensions
Answers.UserDisplayName: MastaP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-24T18:54:46.023Z
Answers.Text: Ok! I was able to hack my way through. But now the API csv Import module does not have a field called "Entity To Import... looks like I can only import contacts.
Answers.UserDisplayName: MastaP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-24T21:12:36.483Z
Answers.Text: Update. We're at 4.2 The API CSV Import only seem to be working for groups on 4.6 ... Any other solution? thanks!
Answers.UserDisplayName: MastaP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-23T17:24:20.677Z
Answers.LastActivityDate: 2015-04-23T17:24:20.677Z
Answers.UserDisplayName: Laryn
Body: <p>50 groups were deleted by mistake. Please don't ask how.</p>
  
  <p>So from a 2 weeks old backup, we're able to extract a CSV from civicrm_group and civicrm_group_contact</p>
  
  <p>group_id, name, contact_id, email</p>
  
  <p>We would like to reimport the groups and their assignation to contacts. The contacts are already in the system normally. We would not want duplicate users</p>
  
  <p>Afraid of simply going to the civicrm_group_contact table and just filling it through phpmyadmin</p>
  
  <p>Any tip? Thanks!</p>
  
Tags: <groups><import>
Title: Restoring groups and linked contacts
ThreadText: # Restoring groups and linked contacts
  
  (Asked by: username_0 on 2015-04-23)
  
  50 groups were deleted by mistake. Please don't ask how.
  
  So from a 2 weeks old backup, we're able to extract a CSV from civicrm\_group and civicrm\_group\_contact
  
  group\_id, name, contact\_id, email
  
  We would like to reimport the groups and their assignation to contacts. The contacts are already in the system normally. We would not want duplicate users
  
  Afraid of simply going to the civicrm\_group\_contact table and just filling it through phpmyadmin
  
  Any tip? Thanks!
  
  **Tags:** groups, import
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-04-23. Score: 2
  
  If you are confident the users are all there, you could do an import with the CSV dump you mentioned, using the **Group ID** and **Contact ID**.
  
  1) [Batch import the groups](https://civicrm.stackexchange.com/questions/404/how-do-i-import-75-groups) using the [API csv Import](https://civicrm.org/extensions/api-csv-import-gui) module.
  
  2) Assuming the Group IDs could be imported and match up, you could import the users via their internal IDs. Instead of selecting "Group" for the *Entity To Import* (as in step 1), you can import "GroupContact" and match up the Group ID field and the Contact ID field.
  
  > **Comments:**
  > **username_0**: Thanks username_1! Looks promising... I am trying to install it according to this page https://wiki.civicrm.org/confluence/display/CRMDOC42/Extensions , but I am missing the following menu item : Administer » System Settings » Manage CiviCRM Extensions  
  > **username_0**: Ok! I was able to hack my way through. But now the API csv Import module does not have a field called "Entity To Import... looks like I can only import contacts.  
  > **username_0**: Update. We're at 4.2 The API CSV Import only seem to be working for groups on 4.6 ... Any other solution? thanks!  
  
  ---
  
  