Custom Field Suite – Mapping Imported Custom Meta Fields to CFS
If you imported content into WordPress, you may notice that the CFS fields don’t recognize the imported meta data for custom fields even though you inserted them using the correct CFS meta key. To map this meta data to CFS, you will need to manually map them using phpMyAdmin.
After you have created you Custom Field Suite Field Group fields, you would use the meta_key name and the Field Group field ID to perform the update.
In the following example, we created a field with CFS Field Group with the slug cfs_time. By inspecting either the Add New Post or Edit Post page using F12, we know the input field name = cfs[input][value] so our field ID is 14.
To insert or update the wp_cfs_values table using data from the wp_postmeta table, we use the following statement.
REPLACE INTO wp_cfs_values( wp_cfs_values.`field_id`, wp_cfs_values.`meta_id`, wp_cfs_values.`post_id` ) SELECT 14, wp_postmeta.meta_id, wp_postmeta.post_id FROM wp_postmeta WHERE wp_postmeta.meta_key = 'cfs_time'