Moving an MT Comment to the Proper Entry
It surprises me how frequently people mistakenly comment on the wrong entry, but though I don't have many comments here, it has happened more than once.
It is mystifying why one cannot move a comment to a different Entry with the Movable Type application (mt.cgi).
Fortunately, I chose to use external SQL database support rather than the built-in support for Berkeley DB. If I hadn't, I don't know how I would be able to move a comment.
So, my data is in a MySQL database. Given a choice, I'd prefer PostgreSQL, but MySQL is what was available and it serves well enough.
Let me document what I did for myself and anyone else in a similar straight.
- Connect to the server:
% mysql -h <SQL-db-hostname> -u <id> -D <db-name> -p
- Identify comment
In this case, this was the only comment from a particular IP number:
mysql> SELECT comment_id,comment_blog_id,comment_entry_id,comment_ip,comment_email FROM mt_comment WHERE comment_ip = '10.0.0.182'; +------------+-----------------+------------------+----------------+---------------------+ | comment_id | comment_blog_id | comment_entry_id | comment_ip | comment_email | +------------+-----------------+------------------+----------------+---------------------+ | 36 | 1 | 16 | 10.0.0.182 | kom48ff84@yahoo.com | +------------+-----------------+------------------+----------------+---------------------+
- Change the comment_entry_id. In this case, moving from Entry 16 to 27:
mysql> UPDATE mt_comment SET comment_entry_id = 27 WHERE comment_ip = '10.0.0.182'; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0
- Check the result:
mysql> SELECT comment_id,comment_blog_id,comment_entry_id,comment_ip,comment_email FROM mt_comment WHERE comment_ip = '10.0.0.182'; +------------+-----------------+------------------+----------------+---------------------+ | comment_id | comment_blog_id | comment_entry_id | comment_ip | comment_email | +------------+-----------------+------------------+----------------+---------------------+ | 36 | 1 | 27 | 10.0.0.182 | kom48ff84@yahoo.com | +------------+-----------------+------------------+----------------+---------------------+
- Rebuild pages.