Support » Fixing WordPress » Convert Twice

  • I converted my old Blogger to WordPress this week at . It’s working great.
    I have a couple of dozen posts where I first started over at Livejournal. What happens if I convert twice?
    I’m hoping it’ll add the old Livejournal posts to my current WordPress. I’m worried that instead it’ll munge the entire database, corrupting it so it’s completely trashed.

Viewing 2 replies - 1 through 2 (of 2 total)
  • I’m trying to read the “import-livejournal.php” file but I don’t know php yet. But this part looks like it only inserts posts:

    $wpdb->query(“INSERT INTO $tableposts
    (post_author, post_date, post_date_gmt, post_content, post_title,post_status, comment_status, ping_status, post_name)
    (‘$post_author’, ‘$post_date’, DATE_ADD(‘$post_date’, INTERVAL ‘$add_hours:$add_minutes’ HOUR_MINUTE), ‘$content’, ‘$title’, ‘publish’, ‘$comment_status’, ‘$ping_status’, ‘$post_name’)”);
    $post_id = $wpdb->get_var(“SELECT ID FROM $tableposts WHERE post_title = ‘$title’ AND post_date = ‘$post_date'”);
    if (!$post_id) die(“couldn’t get post ID”);
    $exists = $wpdb->get_row(“SELECT * FROM $tablepost2cat WHERE post_id = $post_id AND category_id = 1”);
    if (!$exists) $wpdb->query(“INSERT INTO $tablepost2cat (post_id, category_id) VALUES ($post_id, 1) “);
    echo ‘Done!


    I’d like a pair of eyes that knows php to confirm that first. :/

    Never mind. I got impatient. 😛
    Also after reading the php, it was pretty clear this was an importer, meant to be run more than once, so I should be safe.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Convert Twice’ is closed to new replies.