This will get all posts with $old_tax, copy the terms from $old_tax to $new_tax, and then set the $new_tax terms for those posts.
<?php
function convert_tax($old_tax, $new_tax) {
$pages = get_posts(array(
'post_type' => 'post',
'posts_per_page' => -1,
'tax_query' => array(
array(
'taxonomy' => $old_tax,
'operator' => 'EXISTS'
)
)
));
foreach($pages as $post) {
$terms = get_the_terms( $post->ID, $old_tax );
$term = array();
foreach( $terms as $t ) {
if( get_term_by( 'name', $t->name, $new_tax ) == false ) {
wp_insert_term( $t->name, $new_tax, $args = array() );
wp_set_post_terms($post->ID, array(intval($t->ID)), $new_tax );
}
}
}
}
convert_tax('policy_area', 'topic')
?>