Body: <p>I'm trying to migrate data using the API and I'm having issues with UFField. Some entries are inserted correctly while others give me the following error:</p>
  <p><code>Fatal error: Uncaught API_Exception: [0]: The field_name is not valid</code></p>
  <p><code>thrown in /.../wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/UFField.php on line 61</code></p>
  <p>This happens whether I'm using a field that exists after installing CiviCRM such as participant_status or whether I use custom groups. I have already migrated all UFGroup and CustomGroup entries and corresponding custom group tables were created without issue.</p>
  <p>What does field_name even refer to? I can't seem to find any info in the documentation and by looking through the database or API. Any help?</p>
  <p>I am using CiviCRM version 5.46.2 on Wordpress.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-03-03T11:17:52.860Z
Comments.Text: Are you migrating CiviCRM database to a different solution ?
Comments.UserDisplayName: Ramesh - ARTECH Consultancy
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-03-04T14:55:11.160Z
Comments.Text: I am migrating from a Drupal instance of CiviCRM to a Wordpress instance, if that's what you're asking.
Comments.UserDisplayName: lapmir
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-03-04T14:57:22.007Z
Comments.Text: you don't have to migrate the data you can convert the database - https://docs.civicrm.org/sysadmin/en/latest/misc/switching-cms/drupal-to-wordpress/
Comments.UserDisplayName: Ramesh - ARTECH Consultancy
Tags: <api><migration>
Title: Creating UFField using API - error with field_name
ThreadText: # Creating UFField using API - error with field_name
  
  (Asked by: username_0 on 2022-03-02)
  
  I'm trying to migrate data using the API and I'm having issues with UFField. Some entries are inserted correctly while others give me the following error:
  
  `Fatal error: Uncaught API_Exception: [0]: The field_name is not valid`
  
  `thrown in /.../wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/UFField.php on line 61`
  
  This happens whether I'm using a field that exists after installing CiviCRM such as participant\_status or whether I use custom groups. I have already migrated all UFGroup and CustomGroup entries and corresponding custom group tables were created without issue.
  
  What does field\_name even refer to? I can't seem to find any info in the documentation and by looking through the database or API. Any help?
  
  I am using CiviCRM version 5.46.2 on Wordpress.
  
  **Tags:** api, migration
  
  > **Comments:**
  > **username_1**: Are you migrating CiviCRM database to a different solution ?  
  > **username_0**: I am migrating from a Drupal instance of CiviCRM to a Wordpress instance, if that's what you're asking.  
  > **username_1**: you don't have to migrate the data you can convert the database - https://docs.civicrm.org/sysadmin/en/latest/misc/switching-cms/drupal-to-wordpress/  
  
  ---
  
  ## 0 answers
  
  