Old upgraded multisite with duplicate terms issue
-
Hi there,
I’m working on a huge (16gb DB) old multisite (old as 3.8, maybe 2.9), trying to upgrade it to recent version.
I installed clean WP and linked it to the old DB, then ran db-upgrade with the wp-cli.My biggest issue at the moment is weird behavior of terms, when updating a term through the admin UI, a new term is created in the db, without any taxonomy relation.
When combined with a termmeta field, the termmeta is attached to the new orphan term.I investigated a bit more and found out that terms with the same name are registered with different term_id in wp_terms, but in wp_term_taxonomy they show up with the same term_id.
I can reproduce it by:
1. Adding new category ‘new category test’.
2. Adding new tag ‘new category test’.
3. now wp_term_taxonomy has duplicate term_id and when I’m trying to edit the new category/tag i’m getting permission error, because of the DB’s mishap.I’m really confused, and pretty sure it’s something to do with the terms changes in previous versions like 4.2/4.3.
Does different terms should have the same term_id in the wp_term_taxonomy table?
Does the term ‘associative’ has something to do with it?
How can I verify that my upgrade process was complete and the table’s structure and data are now fully up-to-date?I will appreciate any kind of help!
Edit:
Attached some screenshots from my DB for better understanding:
wp_terms query
wp_term_taxonomy queryEdit 2:
Attached a mysql error that wordpress is catching while creating the post_tag:[19-Nov-2017 14:33:11 UTC] WordPress database error Duplicate entry '4860755' for key 'PRIMARY' for query UPDATE 'wp_terms' SET 'term_id' = 4860755 WHERE 'term_id' = 4860756 made by do_action('wp_ajax_add-tag'), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, wp_ajax_add_tag, wp_insert_term, apply_filters('term_id_filter'), WP_Hook->apply_filters, call_user_func_array, global_terms, QM_DB->query
The topic ‘Old upgraded multisite with duplicate terms issue’ is closed to new replies.