• I screwed up my blog after upgrading (from 2.2 to 2.3) without turning off my plugins. I then managed to restore it but lost my categories. I had as a backup a big file (around 18 megs) that the WP export functionality returns. Since it was for v.2.2 I couldn’t directly restore it to 2.3 (or at least I couldn’t do it).

    Now, after working in my own private laptop (with xampp) so I can circumvent the upload limit in php.ini for restoring an xml file, I could go from my 2.2 backup to 2.3 and generate an SQL backup.

    Doing a test I got my categories back so I know my 2.3 backup is working. How can I restore categories for each post in my blog?

    And being picky, how can I keep the new stuff generated in these 2 days? A few comments and a couple of posts but I’m sure there’s a way.

    Thanks in advance,
    Felix.

Viewing 3 replies - 1 through 3 (of 3 total)
  • I don’t know about keeping the recent ones, but you probably could take an old backup and just restore the comments into the database.

    If you open the sql backup file in a text editor you’ll see that each part of the blog is a separate section of the database. (ex. pots, comments, categories, etc)

    You have to be able to login your phpmyadmin so you can manually dump the sql into the database restoring the part you want.

    This is a good thing to know, and it gives flexibility. I use this method, but you do have to take a little time to get into phpmyadmin on your site, and learn the ropes a bit. BEWARE that messing around with the database can mess up your blog content so make sure you have a full backup to fall back on if need.

    Someone else may have a better suggestion for you that;s a bit more simple. I think this method is kinds fun. I call it doing a core dump (too much star trek I guess)

    Gav

    Thread Starter loauc

    (@loauc)

    This seems a little bit more complicated than that. I think if I generate a mysql dump using REPLACE instead of INSERT with phpMyAdmin I could fix my lost categories.

    Hope someone with experience in MySQL will read this and point me in the right direction.

    Will do a test on my lap just to check the REPLACE function works as expected.

    Felix.

    If you used the WP backup plugin it should already have the replace code. You could also drop the categories file, and then dump the new one in.

    Heres an excerpt of the code that used when I dump/replace. I took out most of the content to make it short, but the opener and ender are as I use them

    # ——————————————————–
    # Table: wp_categories
    # ——————————————————–

    #
    # Delete any existing table wp_categories
    #

    DROP TABLE IF EXISTS wp_categories;

    #
    # Table structure of table wp_categories
    #

    CREATE TABLE wp_categories (
    cat_ID bigint(20)….
    #
    # End of data contents of table wp_categories
    # ——————————————————–

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Restoring categories?’ is closed to new replies.