Answers.Body: <p>Unfortunately <strong>NO</strong>, updating saved_search_id to NULL will actually convert it to normal group but no contact's will get added into this group since for smart group the contact are calculated from civicrm_group_contact_cache table which is rebuild periodically and for normal group its from civicrm_group_contact which is static. So you will need to first rebuild the contacts for a group and then move data from cache to static table like</p>
  
  <pre><code>INSERT IGNORE INTO civicrm_group_contact (group_id, contact_id, status)
  SELECT group_id, contact_id, 'Added' FROM civicrm_group_contact_cache 
    WHERE group_id IN (1);
  </code></pre>
  
  <p>HTH</p>
  
  <p>Pradeep</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-18T11:21:05.557Z
Answers.Text: Cool - that's what I was hoping! I'll be generating the group once a day from a script. Just wanted to check that removing the saved_search_id was all I needed to stop it being treated as a smart group. Thanks!
Answers.UserDisplayName: Andrew West
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-17T14:46:50.873Z
Answers.LastActivityDate: 2018-07-17T14:46:50.873Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>We have a bunch of smart groups that a lot of other smart groups rely on. I'd like to turn these former groups into regular groups and then generate them once a day, to improve performance. But deleting them and reconfiguring all the other groups with the replacements will be quite fiddly, so I'm wondering if I can convert them.</p>
  
  <p>Has anyone tried this? Can I just edit civicrm_group to remove the:</p>
  
  <ul>
  <li>saved_search_id</li>
  <li>where_clause</li>
  <li>select_tables</li>
  <li>where_tables</li>
  </ul>
  
  <p>? Just wondering if there are any gotchas I need to be aware of.</p>
  
Tags: <smartgroups>
Title: Can I convert a smart group to a static group by editing the db directly?
ThreadText: # Can I convert a smart group to a static group by editing the db directly?
  
  (Asked by: username_0 on 2018-07-17)
  
  We have a bunch of smart groups that a lot of other smart groups rely on. I'd like to turn these former groups into regular groups and then generate them once a day, to improve performance. But deleting them and reconfiguring all the other groups with the replacements will be quite fiddly, so I'm wondering if I can convert them.
  
  Has anyone tried this? Can I just edit civicrm\_group to remove the:
  
  * saved\_search\_id
  * where\_clause
  * select\_tables
  * where\_tables
  
  ? Just wondering if there are any gotchas I need to be aware of.
  
  **Tags:** smartgroups
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-07-17. Score: 4 | Accepted answer
  
  Unfortunately **NO**, updating saved\_search\_id to NULL will actually convert it to normal group but no contact's will get added into this group since for smart group the contact are calculated from civicrm\_group\_contact\_cache table which is rebuild periodically and for normal group its from civicrm\_group\_contact which is static. So you will need to first rebuild the contacts for a group and then move data from cache to static table like
  
  ```
  INSERT IGNORE INTO civicrm_group_contact (group_id, contact_id, status)
  SELECT group_id, contact_id, 'Added' FROM civicrm_group_contact_cache 
    WHERE group_id IN (1);
  
  ```
  
  HTH
  
  username_1
  
  > **Comments:**
  > **username_0**: Cool - that's what I was hoping! I'll be generating the group once a day from a script. Just wanted to check that removing the saved_search_id was all I needed to stop it being treated as a smart group. Thanks!  
  
  ---
  
  