Forums

Restoring a single blog story and it's associated comments (5 posts)

  1. entropy1024
    Member
    Posted 9 months ago #

    I have just noticed that one blog post I wrote a couple of years ago has vanished. I have no idea how or when it got deleted. I maintain my own site at http://www.entropy1024.com/blog.
    The good news is I backup my blog every month so I do have a copy of it and the comments.

    I have read how to restore the entire database of posts, but how do you restore just one post and it's comments?

    Many thanks for any help.
    Cheers
    Tim

  2. Sam Scholfield
    Member
    Posted 9 months ago #

    You could go into your database and copy across the SQL for the single post. This should go into wp_posts.

  3. entropy1024
    Member
    Posted 9 months ago #

    Thanks for the reply, but how exactly do I go about this?

    I have found an 'Import' option under Tools and then selected 'Wordpress'. However I am worried this will upload all the posts and not let me select to restore a single one. As the last backup I have with the missing post is a few months old and before I wrote a few other newer posts. So if I restore all I will lose the newer posts.

    Many thanks
    Tim

  4. Sam Scholfield
    Member
    Posted 9 months ago #

    Ok, go into your backup file, there will hopefully be a file called sql or database or something along those lines.

    In there there should be a large statement starting like INSERT INTO wp_posts VALUES .....

    take a copy of this file (so your not editing the back-up file). In this copied file, try and strip out everything that isn't the line of sql for that specific post. Go to your database and use the SQL to insert the post back into your database.

  5. entropy1024
    Member
    Posted 9 months ago #

    The backup database file is a single large (6meg) file called entropyo_blog_wp_20091213_085.sql

    I have opened it using notepad and can find a whole host of INSERT INTO wp_posts VALUES
    I have found one that seems to be just before the missing post. Do you mean I should copy and paste from this SQL file?

    Is so, how do I know where I should copy too? Whats the last bit of text to copy too, is there a terminating bit of text I should look for?

    Where do I paste this text too? Do I create another notepad file and rename it to MissingPost.sql? Then do I use the Insert option in WordPress and this will just insert that single missing post into my existing blog from the newly created MissingPost.sql file?

    Many thanks for the help.
    Below is a short cutting from my SQL file just to make sure I have the start point correct.

    [Excerpt removed as it made the spam filter have a huffy princess day - Mod.]

Reply

You must log in to post.

About this Topic