Skip Navigation

[Resolved] Relationship isn’t being added in the database

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 15 replies, has 1 voice.

Last updated by larryB-3 1 hour, 44 minutes ago.

Assisted by: Minesh.

Author
Posts
#2825355

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

ok - I understand now, this could be due to the posts where the "_wpcf_belongs_artist_id" column value is missing could be created after updated to new post reationship. With old (legacy) psot relationship we used to manage post-relatioin using postmeta key "_wpcf_belongs_artist_id" but that is not the case with new post relationship.

Toolset stores the post-relationship information in its specialized tables, which is why you're not seeing connection information in meta keys/custom fields.

To understand how to export the related posts information, you'll first need to understand how Toolset would expect it during the import process. The following guide on the topic will make this more clear:
https://toolset.com/course-lesson/importing-content-from-csv-with-post-relationships/#how-toolset-associations-can-be-added-to-a-csv

In summary, in your export file, you'll need to include the title of the parent post, as a value in the custom meta key in format "_toolset_associations_%relationship_slug%", with each child post.

However - I found a better way.

You will have to use native WordPress export.

What I've done is I've setup a brand new sandbox site and then I've exported the Types structure (that will export post types, taxonomies, custom fields, custom field groups) definations.

So, I've exported the Types structure from:
Toolset => Export / Import => Types tab and click on the button "Export" to export the Types structure from your site.

I've created the following sandbox site and you can auto-login to it using the following link:
- hidden link

Now, I've impoarted the Types structure that I exported from your site to the sandbox site:
=> Toolset => Export / Import => Types tab => Import Types data section and upload the file that I've exported from your site and click on the button "Review and Import".

So, all post types, custom fields, taxonomies, post relationship will be automatically created to the sandbox site.

Now, I navigate to your site, and exported:
=> Tools => Export and selected the Artist (parent) post type that will offer you XML file
=> Tools => Export and selected the Art (child) post type that will offer you XML file

To import the content to sandbox site I've created, I navigate to:
=> Tools => Import and first imported the Artist (parent) post type XML file
=> Tools => Import and first imported the Art (child) post type XML file

Then, I navigate to:
=> Toolset => Export / Import => Associations tab and you will see it will show you to associations for your post relationship and you can click finish the process by click on the button "Start Import".

Then with I check any Art post that you claim missing relations as per the following screenshot:
- https://toolset.com/wp-content/uploads/2025/09/2825339-Screenshot_2025_09_17_at_7.15.59_AM.jpg

Like:
- hidden link
- hidden link

I can see it does show related post on post edit page.

#2825471

As a workaround. I had to export the data, replicate the existing data in the _wpcf_belongs_artist_id to a new field for use in the mobile app and then manually look up and replace the 23 missing records for _wpcf_belongs_artist_id and then start using that field. I will manually control this going forward as there are only a few records added each year.