Jump to content

Changing tags across entire system


Recommended Posts

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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

@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.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...