Support

Account

Home Forums ACF PRO 5.5.1 – database update 'loop' Reply To: 5.5.1 – database update 'loop'

  • ACF isn’t mine, I’m just another user trying to help out. It could be correct that ACF is timing out moving all the options to the termmeta table. I just took a look at the update process ACF gets all the values from the options table in a single query but then it updates the values using update_metadata one field at a time. This is where you were hitting the problem. There’s a very good chance that not all of your termmeta got updated properly.

    In this case, this is what I would do. First, I’d revert the site to what it was before the update, if you have a backup.

    The next thing I’d do is add an action on this hook in the update

    
    do_action('acf/update_550_term', $term);
    

    That would add the term to a local file so that I can see which ones have been successfully updated. This hook is called after updating each term.

    Then I’d try the updating again and doing the db upgrade. When it times out, look in the file and see what terms were successfully updated and then manually delete all of the ACF fields from the options table for those terms. Then do the DB upgrade again. Rinse and repeat until it’s able to complete the process.

    … or rather than manually delete them, in the action filter instead of outputting the term to a file, do a query to delete all of those fields. Take a look at the function acf_update_550_term, the get query used could easily be converted to a delete query.

    Of course, for anyone that’s reading this, make sure you back up your database before trying my advice.