thanks for the fast respons. The link is certainly informative.
I understand from that text that ACF is using the field’s key reference for formatting the data. In my case it is text (that should not give problem) and relations between two custom post-types (that might become a problem, because it probably needs special field settings).
I am migrating from tables outside the wp-databases, so all posts that I create will be new.
It is just php, reading a table, going through all records, for each record create a post with wp_insert() and for each custom field create a metapost referring to this post with add_post_meta(). I did not find creation-functions in the ACF API, so I use the WP functions.
I already migrated two tables with only text fields and there are no field keys. A soon as I open the post in wp-admin and save, then the field keys are there.
I conclude from the information and some trials, that the field’s key reference is not specific for each record, but for the custom field. So I only have to save a post with custom fields in wp-admin once, and the reference is set.
If that conclusion is incorrect I would appreciate to hear that, but I consider the issue solved now.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!