Don’t have a time to test it now but something like this should work:
// Change or add your own arguments as needed
$args = array(
'post_type' => 'post',
'numberposts' => -1,
'offset' => 0
);
$my_posts = get_posts( $args );
if ( $my_posts ) {
foreach ( $my_posts as $my_post ) {
$meta = get_post_meta( $my_post->ID, '_name_of_your_custom_field', true );
if ( ! empty( $meta ) )
wp_set_post_terms( $my_post->ID, $meta, '_name_of_your_taxonomy');
}
}
You can wrap it in a function, throw it into your functions.php
or make it a plugin. Just be sure you run it just once and not on every page load…
Use the get_posts() arguments to change which posts will be affected. For example you can take advantage of numberposts
and offset
to split the query into a few smaller ones if your server doesn’t feel like processing 1000+ posts at once.
Good luck and let me know if you need more help with any of above.