I manage the server for a site with 30k+ posts. I've tried to update the site from WP 4.9.9 to current WP 5.0.2.
The update seems to work correctly, but then the backend becomes very slow, while the frontend keeps working normally.
After the update mytop
shows many ALTER TABLE wp_posts ... post_password ...
queries running, and, at the top, a copy operation for ALTER TABLE that takes most of the database time.
I tried letting it run for a whole day, but it didn't finish and I can't afford longer downtimes in the backend, so I've recovered the whole installation from backup, and now I'm back with WP 4.9.9.
I know many ALTER TABLE
statements in MySQL are implemented as create new table, copy over, delete old table, rename new table, and I assume this is just what I'm seeing.
However I couldn't find any documentation about that WP 5 update behavior, and I'd be surprised to find out it is actually WP doing that, and no one noticed it yet besides me. More likely I haven't googled properly, or it's not WP to blame, but some plugin.
Does WP really alter wp_posts
table upon upgrade to WP 5? And, if so, what can I do to workaround the problem?
I manage the server for a site with 30k+ posts. I've tried to update the site from WP 4.9.9 to current WP 5.0.2.
The update seems to work correctly, but then the backend becomes very slow, while the frontend keeps working normally.
After the update mytop
shows many ALTER TABLE wp_posts ... post_password ...
queries running, and, at the top, a copy operation for ALTER TABLE that takes most of the database time.
I tried letting it run for a whole day, but it didn't finish and I can't afford longer downtimes in the backend, so I've recovered the whole installation from backup, and now I'm back with WP 4.9.9.
I know many ALTER TABLE
statements in MySQL are implemented as create new table, copy over, delete old table, rename new table, and I assume this is just what I'm seeing.
However I couldn't find any documentation about that WP 5 update behavior, and I'd be surprised to find out it is actually WP doing that, and no one noticed it yet besides me. More likely I haven't googled properly, or it's not WP to blame, but some plugin.
Does WP really alter wp_posts
table upon upgrade to WP 5? And, if so, what can I do to workaround the problem?
2 Answers
Reset to default 1Maybe I'm blind or I'm overlooking something, but...
I don't see any tickets related to that subject in any of these releases:
- https://core.trac.wordpress/query?status=closed&milestone=5.0&group=component&order=priority
- https://core.trac.wordpress/query?status=closed&milestone=5.0.2&group=component
I also don't see any DB operations in code:
- https://core.trac.wordpress/browser/tags/5.0.2/src/wp-admin/includes/upgrade.php#L1820
- https://core.trac.wordpress/browser/tags/5.0.2/src/wp-admin/includes/upgrade.php#L1946
So I don't think that these ALTERS come with WP.
Maybe some plugin (or theme) is responsible for this.
If I were you, I would create a copy of my site, disable all plugins and set the default theme and then run the WP update. And then I would try to find wich plugin is causing these ALTERS.
Another way is to grep code of your site and search for any ALTERs in the code. ALTERs are not so common, so maybe you'll find something.
I think that the problem might be with plugins, not with core (it's almost impossible there was that bug). There is a CODE which makes the problem.
Please do the following:
Deactivate all plugins
Try to upgrate to lastest WP.
- One by one, activate a plugin, and see if it causes/starts the bad behavior. Do this will all plugins (if possible, you should have listed which plugins you use).
ALTER TABLE
inupgrade_500()
or pre_schema_upgrade() targetted for 5.0.2. – birgire Commented Jan 3, 2019 at 9:29