Hi, all. A user of my MT instance accidentally deleted 200 legitimate comments from their blog a couple months ago; I’m now trying to restore those. I have a backup of the MySQL database (using mysqldump) from just before the deletion, so I’ve now created a text file containing all of the deleted comments, in MySQL format, as rows from the comment table.
I was planning to import that data directly into the database from the text file, but I just realized that direct interaction with the database seems likely to be a bad idea; I don’t know whether there are things like comment counts stored elsewhere that I would mess up by doing this.
So do any of you have any advice on how to get the comments back into MT?
I could copy and paste the text of each one into a comment box. The timestamps and IP addresses and such would be wrong, but I could tweak those by hand in MySQL—but I don’t know if that kind of tweaking would cause problems. And I don’t relish the idea of doing all that by hand, one comment at a time.
I imagine that what I really should do is use the MT API to add the comments in bulk, but I’ve never done anything with the API. Is there a script out there somewhere that does bulk adding of comments? Or could someone point me toward tips on how to do that? I’ve done some web searches but haven’t turned anything up.