WordPress.org

Ready to get started?Download WordPress

Forums

Maual SQL Post Upload: What are the wp-postmeta and wp-post2cat tables? (4 posts)

  1. kayaker
    Member
    Posted 8 years ago #

    I have an old postnuke sql file that no longer resides in a db. I've stripped it down to the title, time and post, and want to drop all the old posts (100+) into my new wordpress blog. I can build the "insert into..." commands for the wp-posts table but what do I need to do in the wp-postmets and wp-post2cat tables to get them to jive?

    My plan is to start at my last post number (47) and add from there the commands:

    INSERT INTO wp_posts VALUES (1, 48, '2006...

    Am I up in the night? Will this work? Pitfalls?

  2. Kafkaesqui

    Posted 8 years ago #

    wp_postmeta -> Holds the custom field data.

    http://codex.wordpress.org/Using_Custom_Fields

    Unless you have some sort of "meta" data related to your postnuke material that you wish to carry over into WordPress, you don't have to worry about this one.

    wp_post2cat -> Holds post to category relationship. Basically your import method should work, but the posts will not have any categories assigned to them. You can take care of this manually in WordPress after the import, or you can perform similar inserts on the post2cat table by using something like:

    INSERT INTO wp_post2cat VALUES (NULL, 48, 1);

    where the second value equals the post ID, and third is the category ID.

  3. kayaker
    Member
    Posted 8 years ago #

    Thanks! I figured it out with your help. Am I satisfied? Oh no... now I want more, but have a meager offering.

    I cleaned up my OpenOfficeCalc sheet, saved it into Excel also, and talked a bit about what I did in this post!

    How to bulk import posts into WordPress with Excel and MySQL. I converted an old PostNuke database.

    Now for my next question:

    "How can I get these same imported posts in to multiple categories?" I don't understand databases well, but I'm trying.

  4. Kafkaesqui

    Posted 8 years ago #

    "How can I get these same imported posts in to multiple categories?"

    INSERT INTO wp_post2cat VALUES (NULL, 48, 2);
    INSERT INTO wp_post2cat VALUES (NULL, 48, 3);

    Just keep adding an insert for each category a post belongs to.

Topic Closed

This topic has been closed to new replies.

About this Topic