• 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 query

    Edit 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
    
    • This topic was modified 8 years, 6 months ago by Shebo. Reason: added screenshots
    • This topic was modified 8 years, 6 months ago by Shebo.
    • This topic was modified 8 years, 6 months ago by Shebo.
    • This topic was modified 8 years, 6 months ago by Shebo.
Viewing 1 replies (of 1 total)
  • @shebo, This is over my head. But after thinking about it for awhile It sounds like you could be missing table rows.

    Have you tried installing an old version of WordPress on a testing server and going through the traditional upgrade process?

    I suspect somewhere between versions database upgrades occured that took this problem into account. Without upgrading and simply installing on a fresh server the database may not be upgradable.

    https://ww.wp.xz.cn/download/release-archive/

    Okay second thought…

    Are you able to perform a Network Upgrade through the dashboard?

    Again I’m just guessing here and either one of my suggestions could be worthless and even damage your site. I suggest testing this out on a testing server.

Viewing 1 replies (of 1 total)

The topic ‘Old upgraded multisite with duplicate terms issue’ is closed to new replies.