This snippet will export a file named "import_rules_{import_id}.csv" in your WordPress uploads folder with your taxonomy mapping rules. Be sure to change 'product_cat' to the appropriate taxonomy name if you're not exporting WooCommerce Product Category rules.
function my_export_maprules( $import_id ) {
$import = new PMXI_Import_Record();
$import->getById( $import_id );
if ( $import->isEmpty() ) return false;
$options = maybe_unserialize( $import->options );
$rules = $options['tax_mapping']['product_cat'];
$rules = json_decode( $rules, 1 );
$uploads = wp_upload_dir();
$filename = $uploads['basedir'] . '/import_rules_'.$import_id.'.csv';
if (file_exists($filename)){
@unlink($filename);
} else {
touch( $filename );
}
$csv = array( array( 'In Your File', 'Translated To' ) );
foreach ( $rules as $rule ) {
$key = key( $rule );
$csv[] = array( $key, array_pop( $rule ) );
}
$fp = fopen( $filename, 'w');
foreach ( $csv as $fields ) {
fputcsv( $fp, $fields );
}
fclose( $fp );
}
Usage:
my_export_maprules( 8 );
Change "8" to your import ID. You can use the Code Snippets plugin ( https://wordpress.org/plugins/code-snippets/ ) and their "Only run once" feature to run the code.