Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
mcsg Posted November 19, 2019 Posted November 19, 2019 We have a group of tags users assign to forums posts and topics. We have decided to migrate those tags to a new set, and have build a relation table between the old tags and the new ones. For instance, if we had "PARENTS and "SIBLINGS" in the current tag system, we want to change both into "FAMILY" How can we migrate the old tags to the new ones?
bfarber Posted November 20, 2019 Posted November 20, 2019 There is no built in manner of doing so, and it is not a super simple task at the database level either.
mcsg Posted November 20, 2019 Author Posted November 20, 2019 Thanks @bfarber What am I missing at the database level? It appears that one issue a SQL command to find and replace on the tag names in the "core_tags" and "core_tags_cache" tables? for each NEWTAG: UPDATE core_tags SET tag_text = REPLACE(tag_text, 'TAG', 'NEWTAG') WHERE INSTR(tag_text, 'TAG') > 0 UPDATE core_tags_cache SET tag_cache_text = REPLACE(tag_cache_text, 'TAG', 'NEWTAG') WHERE INSTR(tag_cache_text, 'TAG') > 0 If it is not as simple as this, is there a place I can read in docs on how the tags are organized and set?
bfarber Posted November 21, 2019 Posted November 21, 2019 We don't document database relationships conclusively anywhere. Off the top of my head, you also need to consider core_search_index_tags, or plan to rebuild your search index fully afterwards. You may or may not also want to/need to take into account duplicates (i.e. if a topic had both "parents" and "siblings" as tags, they would end up with two "family" tags based on your description). I cannot say from here if this is a legitimate concern or a theoretical one (or, even if you care - from a technical POV this wouldn't cause any problems).
mcsg Posted November 21, 2019 Author Posted November 21, 2019 @bfarber Thank you for the response. I'll look at 'core_search_index_tags' thanks. But I do plan to rebuild the search index fully, regardless. As for the parent and siblings relationships, I hadn't considered that, and not sure if I understand it in the forums context, but I'll review. I will try this approach on a development server to see what happens.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.