Tags and categories not migrating

Created on 2 December 2024, 4 months ago

Problem/Motivation

The tags and categories all migrated as "Greeked" text instead of the actual tags.

Steps to reproduce

Executed the tags and categories migration.

I've attached a screen shot of the migrated tags, which I'm currently deleting, but I can also add the source XML if that helps. I did verify that the tags were in the export.

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States ryumaou

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @ryumaou
  • πŸ‡ΊπŸ‡ΈUnited States hongpong Philadelphia

    Thanks for filing this. Yeah let's get the xml posted to test against .. if it doesn't allow the upload I can be emailed as well ` hongpong @ hongpong.com ` - if you like I can add it to that outside Repo for test XML files I made as well. Thanks!

    Might want to check this out as well for debugging - https://www.drupal.org/project/migrate_devel β†’

  • πŸ‡ΊπŸ‡ΈUnited States hongpong Philadelphia
  • πŸ‡ΊπŸ‡ΈUnited States ryumaou

    Here's the XML file I was importing. Fairly good size but only posts and no pages.
    Sorry it took so long to get back to you. Thank you again for the great work!

  • First commit to issue fork.
  • πŸ‡ΊπŸ‡ΈUnited States hongpong Philadelphia

    Say ryumaou ticsmart, I compared your file (thanks again for this). Per migrations/wordpress_categories.yml and wordpress_tags.yml there are source item_selector:

    source:
      plugin: url
      data_fetcher_plugin: file
      data_parser_plugin: xml
      urls: []
      item_selector: /rss/channel/wp:category
    

    and

    source:
      plugin: url
      data_fetcher_plugin: file
      data_parser_plugin: xml
      urls: []
      item_selector: /rss/channel/wp:tag
    

    There should be statements like

    <wp:tag>
      <wp:term_id>651</wp:term_id>
      <wp:tag_slug>articles</wp:tag_slug>
      <wp:tag_name><![CDATA[articles]]></wp:tag_name>
    </wp:tag>
    <wp:tag>
    <wp:category>
      <wp:term_id>1</wp:term_id>
      <wp:category_nicename>uncategorized</wp:category_nicename>
      <wp:category_parent/>
      <wp:cat_name><![CDATA[Uncategorized]]></wp:cat_name>
    </wp:category>
    

    And there are not any of those in the sample file provided. There are references to tags like these in your file. but note how it would not have a term_id and the element is not wp;tag or wp:category. So it is not selected.

    										<category domain="post_tag" nicename="creativity"><![CDATA[creativity]]></category>
    		<category domain="post_tag" nicename="entertainment-culture"><![CDATA[entertainment culture]]></category>
    		<category domain="post_tag" nicename="human-interest"><![CDATA[Human Interest]]></category>
    		<category domain="category" nicename="on-creativity"><![CDATA[On Creativity]]></category>
    		<category domain="post_tag" nicename="paul-zii"><![CDATA[Paul Zii]]></category>
    		<category domain="post_tag" nicename="photography"><![CDATA[photography]]></category>
    		<category domain="post_tag" nicename="pinhole-camera"><![CDATA[pinhole camera]]></category>
    		<category domain="post_tag" nicename="psychology"><![CDATA[psychology]]></category>
    		<category domain="post_tag" nicename="stay-creative"><![CDATA[Stay Creative]]></category>
    						<wp:postmeta>
    
  • πŸ‡ΊπŸ‡ΈUnited States hongpong Philadelphia
  • πŸ‡ΊπŸ‡ΈUnited States hongpong Philadelphia

    Ah i saw your comment on the other thread - tags and categories were missing. So at least, I did not get confused and now we have a good logger. πŸ’¬ Import Taxonomy URL Alias Needs review .

    - Readme should get updated later
    - Duplicate terms should be prevented (could happen with matching term IDs or human name conflicting I think)
    - Maybe we can get a garbled entries with multiple imports colliding and not preventing duplicates.

    I think i will call this closed / fixed for now since we addressed the sample here.

    • hongpong β†’ committed 91469ec5 on 8.x-3.x
      Issue #3491146 by ryumaou, HongPong: wordpress_migrate_log_term code...
Production build 0.71.5 2024