Seems like trying to put “field X” into db.table.record.fieldY is too atomic, or requires a better magic wand than google can find. I’ve gone a head and just ripped the posts out wholesale and injected them into the new DB.
Here’s how I did it. I hope it helps the next poor sod who finds himself in the same place I was…
How to rip out and inject WordPress posts from an old database into a new one.
0) Make a backup first of the new DB.
mysqldump -u root -p new_db >> dump-new_db-datetime.sql
1) first, find all your old published posts & pages;
SELECT id,post_date,post_title FROM old_db.old_posts WHERE
post_type="post" AND post_status="publish" ORDER BY id;
2) Delete all your revisions with;
DELETE FROM old_posts WHERE post_type = "revision";
3) inject your old posts & pages into the new DB
INSERT INTO new_db.new_posts
(
post_author,
post_date,
post_date_gmt,
post_content,
post_title,
post_excerpt,
post_status,
comment_status,
ping_status,
post_password,
post_name,
to_ping,
pinged,
post_modified,
post_modified_gmt,
post_content_filtered,
post_parent,
guid,
menu_order,
post_type,
post_mime_type,
comment_count
)
SELECT
old_posts.post_author,
old_posts.post_date,
old_posts.post_date_gmt,
old_posts.post_content,
old_posts.post_title,
old_posts.post_excerpt,
old_posts.post_status,
old_posts.comment_status,
old_posts.ping_status,
old_posts.post_password,
old_posts.post_name,
old_posts.to_ping,
old_posts.pinged,
old_posts.post_modified,
old_posts.post_modified_gmt,
old_posts.post_content_filtered,
old_posts.post_parent,
old_posts.guid,
old_posts.menu_order,
old_posts.post_type,
old_posts.post_mime_type,
old_posts.comment_count
FROM old_db.old_posts;