Answers.Body: <p>For custom fields it's only problematic if there is custom code that references those field names, including mgd files or install hooks, or if there's some extension that stores that name in the database somewhere else in order to reference it. You'd need to update all those too.</p>
  <p>But yes it's just a matter of changing it in the database (<code>civicrm_custom_field.name</code>).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-28T19:11:39.813Z
Answers.LastActivityDate: 2022-12-28T19:11:39.813Z
Answers.UserDisplayName: Demerit
Body: <p>I'm working with some historic data in a Civi database. For about ten years now we have created a custom field set each year to collect the same two pieces of information via an annual survey. We did it this way rather than using a field set which could store multiple values, because of perceived issues accessing data from multi-value fields (via Views etc.).</p>
  <p>So I've now got ten custom field sets, and I'd like to move the custom fields into one larger field set. But the fields from one set have the same machine name as the fields in another set, and so Civi won't let me move them into the same custom field set.</p>
  <p>Of course it's easy to change the field label via the UI, but there's no way to edit the machine name of the field. My assumption is that editing custom field names is problematic, otherwise there would probably be a way to do it. So before I get into the database and start editing field names there, I thought it best to ask: will editing field names in the DB break things? Is there a better way to do it, or am I stuck with what I've got?</p>
  
Tags: <custom-fields>
Title: How can I edit the names (not just the labels) for custom field names?
ThreadText: # How can I edit the names (not just the labels) for custom field names?
  
  (Asked by: username_0 on 2022-12-28)
  
  I'm working with some historic data in a Civi database. For about ten years now we have created a custom field set each year to collect the same two pieces of information via an annual survey. We did it this way rather than using a field set which could store multiple values, because of perceived issues accessing data from multi-value fields (via Views etc.).
  
  So I've now got ten custom field sets, and I'd like to move the custom fields into one larger field set. But the fields from one set have the same machine name as the fields in another set, and so Civi won't let me move them into the same custom field set.
  
  Of course it's easy to change the field label via the UI, but there's no way to edit the machine name of the field. My assumption is that editing custom field names is problematic, otherwise there would probably be a way to do it. So before I get into the database and start editing field names there, I thought it best to ask: will editing field names in the DB break things? Is there a better way to do it, or am I stuck with what I've got?
  
  **Tags:** custom-fields
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-12-28. Score: 1
  
  For custom fields it's only problematic if there is custom code that references those field names, including mgd files or install hooks, or if there's some extension that stores that name in the database somewhere else in order to reference it. You'd need to update all those too.
  
  But yes it's just a matter of changing it in the database (`civicrm_custom_field.name`).
  
  
  ---
  
  