Advertisement

Transfer articles with tags from J3 to J4

Need help upgrading your Joomla! website or converting to Joomla! 4.x?

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
adamnet
Joomla! Apprentice
Joomla! Apprentice
Posts: 28
Joined: Wed Jun 20, 2012 6:04 pm
Location: Spata Attica, Greece

Transfer articles with tags from J3 to J4

Post by adamnet » Fri Mar 21, 2025 6:29 pm

Hello.
I am migrating a Joomla site from J3 to J4. I have transferred all the categories and articles through phpmyadmin successfully. The old site uses tags. There is a large number of articles which are tagged. I have transferred the tables _content
_contentitem_tag_map
_tags
The problem: At the front end when I click a tag there are no articles displayed, In the admin side I can see that this article belongs to this tag. I have to edit the article and save it and then it is displayed under its tag.
Does any one knows any cure of this as I have 2000 tagged articles and it would be crazy to solve this problem by clicking and saving.
Any advice will be much appreciated!
Thank you
:)

Advertisement
gws
Joomla! Champion
Joomla! Champion
Posts: 6642
Joined: Tue Aug 23, 2005 1:56 pm
Location: South coast, UK
Contact:

Re: Transfer articles with tags from J3 to J4

Post by gws » Fri Mar 21, 2025 6:59 pm

Try running this in phpmyadmin, you are possibly missing the workflows tables.
INSERT INTO #__workflow_associations (item_id, stage_id, extension)
SELECT c.id as item_id, '1', 'com_content.article' FROM #__content AS c
WHERE NOT EXISTS (SELECT wa.item_id FROM #__workflow_associations AS wa WHERE wa.item_id = c.id);

adamnet
Joomla! Apprentice
Joomla! Apprentice
Posts: 28
Joined: Wed Jun 20, 2012 6:04 pm
Location: Spata Attica, Greece

Re: Transfer articles with tags from J3 to J4

Post by adamnet » Fri Mar 21, 2025 8:17 pm

gws Thank you for answering.
I know this script which in my case the goes like that:
INSERT INTO evu89_workflow_associations (item_id, stage_id, extension)
SELECT c.id as item_id, '1', 'com_content.article' FROM evu89_content AS c
WHERE NOT EXISTS (SELECT wa.item_id FROM evu89_workflow_associations AS wa WHERE wa.item_id=c.id);

I rerun it but 0 records were inserted. I had already run it before.

gws
Joomla! Champion
Joomla! Champion
Posts: 6642
Joined: Tue Aug 23, 2005 1:56 pm
Location: South coast, UK
Contact:

Re: Transfer articles with tags from J3 to J4

Post by gws » Fri Mar 21, 2025 9:15 pm

Just a guess you were missing workflow data. Yes,you can only run it once, running it a second time will not change anything. Perhaps there is an associated table for tags as well?

adamnet
Joomla! Apprentice
Joomla! Apprentice
Posts: 28
Joined: Wed Jun 20, 2012 6:04 pm
Location: Spata Attica, Greece

Re: Transfer articles with tags from J3 to J4

Post by adamnet » Sat Mar 22, 2025 6:38 am

Yes, there is a table which associates articles with tags __contentitem_tag_map.

CREATE TABLE `evu89_contentitem_tag_map` (
`type_alias` varchar(255) NOT NULL DEFAULT '',
`core_content_id` int(10) unsigned NOT NULL COMMENT 'PK from the core content table',
`content_item_id` int(11) NOT NULL COMMENT 'PK from the content type table',
`tag_id` int(10) unsigned NOT NULL COMMENT 'PK from the tag table',
`tag_date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'Date of most recent save for this tag-item',
`type_id` mediumint(8) NOT NULL COMMENT 'PK from the content_type table',
UNIQUE KEY `uc_ItemnameTagid` (`type_id`,`content_item_id`,`tag_id`),
KEY `idx_tag_type` (`tag_id`,`type_id`),
KEY `idx_date_id` (`tag_date`,`tag_id`),
KEY `idx_core_content_id` (`core_content_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Maps items from content tables to tags'

I cannot find any info how these connection work. There are the columns `tag_id`, `core_content_id` , `content_item_id` which do all the job and relate content articles with tags.

Advertisement

Post Reply

Return to “Migrating and Upgrading to Joomla! 4.x”