How to repair old titles?

Now you only have the one problem left… You have a post, or posts, that have incorrect topic_id field set to a number that doesn’t correspond to a valid topic, or a topic that is abnormal.

If the topic_id is invalid, then you have data inconsistencies in your database, which may trip up your other stuff in the future. You really need to get to the bottom of this.

If the topic_id points to a valid topic, then it is simply something that the rake task hasn’t handled, which is safe.