We migrate from Drupal 6 to WordPress with the excellent script from hidden link.
In Drupal the images were stored in a different kind of 'custom post type' and were attached to the parent post. That was correctly recognized by the migration tool. All was correctly migrated in WordPress. But somehow the relationship between child and parents is lost.
But as we want an much easier workflow I want to attach the images from the child to the parent Custom Post Type directly, without the need to have childpost. As we are talking about 2.000+ records... is there a way to run this automatically? Parent and child share the same (but not completely) the same post-title.
Hi, are you talking about an image stored as a custom field? If so, then you can modify the corresponding postmeta entry's "post_id" value to assign it to a different post. For example, let's say the child post ID is 123, the parent post ID is 345, and the custom image field slug is "your-field-slug". In the WordPress database there is a postmeta table where custom field entries are stored. You will search this table for the row with post_id=123 and meta_key="your-field-slug". This is the entry for the custom image field for the child post. If you edit the entry row and change 123 to 345, the custom image field will no longer be associated with the child post, but will be associated with its parent post instead.
If you must do this for 2000+ records, then a custom script is probably the best approach. It's not a trivial task, because you must be able to determine the correct parent post for each child post, then find the matching postmeta entry or entries and update them. If you need professional assistance, we have a portal available for connecting with skilled independent contractors: https://toolset.com/contractors