[resolved] Accidentally deleted Pages (6 posts)

  1. TrishaM
    Posted 5 years ago #

    Desperate for help here.....

    Followed some incomplete advice this morning to delete the admin user (not a problem in itself as I have two other administrator logins).

    When I checked, the admin user showed 0 (zero) posts, but to be safe I chose another administrator user to "transfer posts and links" to...

    However, what the User admin page did NOT show me was the fact that a large number of Pages (not posts) were created by the admin user, and now those Pages are gone....

    I have a DB backup from two days ago that I can restore from, but in the last two days I've also had a good number of comments left on several posts, which I'd rather not sacrifice.

    Is there a way to just restore those missing pages?

    If so, please leave very clear instructions - I'm not a coder and not a mysql guru - but I do have access via phpMyAdmin and capable of following instructions.

  2. MichaelH
    Posted 5 years ago #

    Assuming you've made no new posts...see if this sounds logical.

    Backup your existing database.

    From your two-day-old backup, restore all tables but the comments and commentmeta tables.

  3. TrishaM
    Posted 5 years ago #

    Thanks Michael - I actually have made 1 new post since the last backup, but I could recreate that post from scratch....that post does have some comments I'd like to keep, but I think I can reassign those to the new post afterwards, yes?

  4. MichaelH
    Posted 5 years ago #

    Correct, though the new post may be a different post ID in the restored database so you'd need to correct the post id on any comments to that post if the id is different.

  5. TrishaM
    Posted 5 years ago #

    Thanks again for your help Michael....

    That is what I wound up doing, mostly -

    I couldn't figure out how to restore just part of the backup - it was created by the WP_DB_Manager plugin, so I made a current backup, then using the Plugin's admin interface I did a restore from my two-day old backup, then I pulled out just those SQL statements for the missing pieces - the new post, post meta, and comments....

    It was a bit time-consuming but I'm fully back to the way it should be now, and I learned a great deal in the process.

  6. TrishaM
    Posted 5 years ago #

    Ooops just read my answer again and realized that it wasn't as clear as it could have been... thought I'd clarify what I did just in case someone else has the same problem and is looking for a solution.

    The backup I had prior to the screwup I made was from the wp_db_manager plugin.

    I went into phpMyAdmin and made a newer, more current backup but did NOT gzip it, and exported it to a file.

    I then went into my wp backend and using the Backup plugin, I restored from my previous backup that still had the pages in them. This put back the db to the state it was in 2 days prior, but naturally I lost the 1 new post I made, plus a number of comments.

    SO I opened my more current backup I made using phpMyAdmin, using a plain text editor, and went through it until I found the SQL statements for the new post, the new post's metadata, and the comments I wanted to restore. I copied and pasted those SQL statements into the SQL tab/box in phpMyAdmin.

Topic Closed

This topic has been closed to new replies.

About this Topic