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
# ——————————————————–