There are some duplicated tags due to database corruption and I can't merge

It sounds like you did it from the UI, but it can’t be done that way. As Jay did, you need to update all topics that use one of the tags to use the other, like in his example:

TopicTag.where(tag_id: 717).update_all(tag_id: 611)
4 Likes