I've noticed a strange issue on one of the sites I manage with WooCommerce database upgrades, for the last couple of releases. Here's the upgrade path the WooCommerce plugin has been through on this site:

3.4.6 -> 3.5.0*
3.5.0 -> 3.5.1
3.5.1 -> 3.5.2*

For the two upgrades marked with an asterisk, a database upgrade was required (there's nothing in my notes about a database upgrade for the middle one, so I assume one wasn't required). But for both of those updates, I didn't get a message in the WordPress dashboard inviting me to run the updater - I only knew to expect one because I had done the same update on other sites.

I found that I could log in and do the update using the CLI though:

# wp wc update
Calling update function: wc_update_352_drop_download_log_fk
Success: 1 updates complete. Database version is 3.5.1
# wp wc update
Calling update function: wc_update_352_drop_download_log_fk
Success: 1 updates complete. Database version is 3.5.1
#

As you can see here though, for the most recent update, the database version remains at 3.5.1, despite the migration apparently running fine. When I try to run the updater again, the same process happens.

What's going on here?

WP Environment Info: https://pastebin.com/raw/2RzN4kmW

  • Are you sure 3.5.2 required a database update? When you previously saw that one was required are you sure you weren't updating from an earlier version? – Jacob Peattie Dec 3 at 6:11
  • I'm pretty sure it did, yeah. Why do you ask? The content of class-wc-install.php seems to suggest that it does, and the name of the update function indicates that it was 3.5.2. I'm sure I wasn't updating from an earlier version - I keep notes about what version upgrades are done on each site and when. I'm sure that the upgrade path mentioned above is correct, so the CLI output above is for 3.5.1 - 3.5.2. – Alex Dec 7 at 16:01
  • Hmm, looking at the wc-update-functions.php file, it seems as though there ought to be a wc_update_352_db_version function ready to queue after the wc_update_352_drop_download_log_fk function, which presumably marks the migration as having been applied... – Alex Dec 7 at 16:09

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.