• Resolved llprice

    (@llprice)


    I messed up the blog, and I’ll probably have to go back and add old posts manually, after deleting Admin (I thought I’d switched those posts to another user).

    Spouse said, first rule; never delete a user, but I did so I have to fix it. I have complete backup, and I’ll probably have to start over and manually add each post, but before I do, I want to try to figure out the relationships and see if I can fix this bugger. I’ve got the ERD.png on my desktop, but some of it is still a bit confusing.

    I’m assuming that I can’t go back and add admin. I’d never get that one back using dashboard for sure.

    So Far: I swapped out the admin number for another 10_user in Cols. user id# of the “wp_posts” table (with a text editor) and then updated that table with a query (I think). I suspect I also need to alter some lines in other tables. What are they? Has anyone got a guide for this kind of thing, or am I really SOL and just getting in over my head?

Viewing 8 replies - 1 through 8 (of 8 total)
  • I have complete backup

    Restoring_Your_Database_From_Backup

    If you don’t have a database backup, don’t start playing with the database. Try to search google for your posts and use cached copies or look at the http://www.archive.org/web/web.php

    Thread Starter llprice

    (@llprice)

    I did a backup _ HAVE the full backup. I made it before the upgrade to the latest version. My blog is broken because I deleted Admin.

    I deleted Admin because I thought it was a security problem in previous versions.
    I also thought I had transfered the post to another user before I deleted it.

    Yup. I screwed up. But I have a backup of the posts in the database.

    What I want to know is, what could be done with the database or xml actually – before I must reinstall everything, and manually pull those posts from the SAVED database (xml) and start over. I can edit in bbedit if I know what tables must be changed. Restoration is not urgent, as the blog is on vacation for a few week anyway.

    If you have a database backup, then restore that–that should restore all your users, posts, categories etc.

    Restoring_Your_Database_From_Backup

    Thread Starter llprice

    (@llprice)

    Hello Michael H,

    Yes, restoration SHOULD work. In perfect world. Then there’s reality.

    I have a recent database backup, and I have a slightly older backup of 2.6 or 2.7.
    I think my next step is to reinstall the old WP and then the old db backup. In the meantime, I just wanted to look under the hood and see if I could fix this DIY style.

    The db backup was made when things were working correctly under 2.6 (or 2.7),

    I knew I’d need that backup when I saw a db error message plastered across the blog after the local server had a bad crash. I don’t know what happened, but I figured that I might as well upgrade (2.7.1) too, as long as I had to do a restore. That recent db backup does not work when imported into the 2.7.1 upgrade.

    I noticed that a new export and that old backup look different. In old db, each row is proceeded by INSERT INTO… ; , but in the 2.7.1 backup, there is one INSERT for large blocks of table of data. Interesting, but probably not too significant.

    In the new export, I noticed that there were two sets of INSERT for wp-posts table. I tried to turn that into one insert, but the test import still doesn’t show my old posts, only the second set – a few posts made after the 2.7.1 upgrade.

    Where could I find more information about this, or is the ERD chart about all I’m going to get?

    I write this laughing, while totally ignoring your question 😉

    First of all–backup your current “screwed up” database!

    If your database from before you started this fiasco was from an old version of WordPress, and you now have 2.7.1 files installed, restore your database and navigate to wp-admin/upgrade.php to cause the database to be upgraded to 2..7.1

    Once you’ve done that, look at the database and figure out how things are structured.

    Then for the funny part hahaha —
    Drop your 2.7.1 tables, restore your “screwed up” database you backed up, then start playing.

    So for the serious part–if you have a good backup from before things fell apart, you would restore that database, then if you have 2.7.1 files on your server, then navigate to yourdomain.com/wp-admin/upgrade.php.

    Maybe I’m missing something but it seems you are making it more completx that it has to be.

    Thread Starter llprice

    (@llprice)

    Hey, thanks Michael,

    I suppose I should cease noodling at the code level and just do what you suggest. With my luck, that might not work either, but at least I know where to go get the contents of all the posts as a last resort.

    L.L. Price

    Thread Starter llprice

    (@llprice)

    Wow, it worked fine after I ran the upgradel I think I did anyway. I didn’t see anything happening, but my old posts returned. Backed up the db again so I can start working on the issues highlighted by the new security plugin.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Some DB knowledge, but can someone answer a few questions?’ is closed to new replies.