• akamaddisk

    (@akamaddisk)


    Hi, I have an existing blog and I’m setting up a new blog in another location. I would like to export only posts from a certain date range and then import into the new blog. I know how to perform the export and import via phpMyAdmin (I use bigdump.php for the import, it’s a fairly large DB) but I’m not sure how to go about only exporting/importing posts from a certain date range. For example all the posts from February.

    Advice anyone? Much thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • MichaelH

    (@michaelh)

    Two possible choices, using the Tools->Export thing…

    Assign the February posts to an author then restrict the Export to that author.

    Or Export then edit the XML file to delete all unwanted posts, then import.

    It would also be possible to export to a .sql file using phpMyAdmin or mysqldump.

    Then use your handy-dandy unix text-processing tools to go into the wp_posts section (I actually export my tables to separate files) remove the rows that include posts with the earlier dates (you could use sed, or even perl, if you’re a perl ninja). Or, if we’re talking about a small dataset, you could do it by hand.

    If you use categories or tags, you’ll need to go into the wp_term_relationships table, and remove any rows with object_id matching your removed wp_posts.id’s. Same with wp_postmeta.post_id. Oh yeah. wp-comments too. Could be a nightmare.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Export posts from specific date range and then import another blog’ is closed to new replies.