You should wirte a Function or Plugin inside WordPress to achive that.
First, you could insert the tables into your WordPress Database.
After that, make sure you make good use of the WordPress postsstructure. Set up a Loop through your existing Posts that you want to import.
At each Post create a WordPress Post using wp_insert_post()
. This Function returns the ID of your new Post.
Every bit of Metadata that you want to add to your Post is added afterwards.
It would be like this:
foreach ( $existingposts as $existingpost ) {
$newPostData['post_date'] = $existingpost['post_date'];
// and so on, make sure to populate all the fields except the ID parameter, as this one is given by WordPress
$newPostID = wp_insert_post( $newPostData );
add_post_meta( $newPostID, '_firstPostMeta', $existingpost['firstPostMeta'] );
// and so on, every Meta at a time
}
Be sure to test your function before looping it through all the posts at once. You may want to divide your stack of existing posts into groups of 20 or 50, depending what your server is capable to do, to avoid inconsitensies due to server timeout.