After reading https://toolset.com/documentation/user-guides/how-to-import-content-into-wordpress-using-csv/ , it is not clear how to relate the new entry to a different custom post type.
For my example:
I have a csv list of products. These products (= custom post type) are related to departments (= custom post type) through a many-to-one relationship.
In my csv file, how do I relate the product in a row to a specific department? All departments have been created, so I do have access to their respective ids.
Dear Roland,
I don't think it is possible within CSV Importer plugin, since Types is using a custom field "_wpcf_belongs_[parent-cpt-slug]_id" to store the parent post IDs, and if the you import the parent post into the new website, the post ID is different from the original website, so the parent/child relationship will not work as expected.
I suggest you try these, import the posts of parent post types(products and department), then manually setup the "_wpcf_belongs_[parent-cpt-slug]_id" value, then import the child post type into the new website.
Thank you for your answer. I am not sure what you mean with your reference to "new" and "original" website. I have the data in Excel sheets and need to get it into a website.
It seems that it is selecting the correct department when using the "_wpcf_belongs_[parent-cpt-slug]_id" does somehow select the right department but I still need to go into the product and save before it shows up in my product list.
Ok, solved it. I made the mistake of using my department's post slug and not the actual post type's slug. So in my case, I needed to add a column
_wpcf_belongs_department_id
and populate the column with the id of the department post.