Automattic / newspack-custom-content-migrator

Custom migration tasks for launching and migrating Newspack sites on Atomic
5 stars 5 forks source link

Add / TagDiv Primary Categories Migrator #481

Closed ronchambers closed 5 months ago

ronchambers commented 6 months ago

This PR adds a general use TagDiv "Themes and Plugins" migration command for converting TagDiv postmeta into Yoast primary categories. This command's logic is simply: if postmeta td_post_theme_settings => td_primary_cat exists, set it as the Yoast primary (and add cat/post term relationship if missing), otherwise, set the first category as the Yoast primary.

Usage: wp newspack-content-migrator migrate-tagdiv-primary-categories

Optional: --dry-run

Output Log: TagDivThemesPluginsMigrator_cmd_migrate_tagdiv_primary_categories.log

Notes:


ronchambers commented 6 months ago

Hi all ( @naxoc , @eddiesshop , @jorostoyanov , @kariae ), @iuravic recommended that I include everyone on my merge requests (since I'm not a member of the @newspack-launch-and-infrastructure github group). Feel free to give a look at this pull request (and other function in this same file) in case you have a future need to migrate a site that uses TagDiv themes or plugins.

@naxoc - since you helped me run this command last week and it was successful, would you like to review/merge? Or do you think it's fine if I just merge it myself since it's been fully tested, was successfully run, and I notified the team above? Thanks!