admin管理员组文章数量:1130349
And where do I (reliably) look for this kind of information? I find myself googling for 'wordpress changelog' on every other update...
Background: usually I use a "skeletal" WP installation (seperate wp/app and wp-content folders), so I could try out the new major version and check for theme incompatibilites by "hotswapping" the wp folder. And I'm worried that "swapping back" might not work due to a migrated DB. Yes I know, I should always back it up before an update anyway. Question still stands :)
And where do I (reliably) look for this kind of information? I find myself googling for 'wordpress changelog' on every other update...
Background: usually I use a "skeletal" WP installation (seperate wp/app and wp-content folders), so I could try out the new major version and check for theme incompatibilites by "hotswapping" the wp folder. And I'm worried that "swapping back" might not work due to a migrated DB. Yes I know, I should always back it up before an update anyway. Question still stands :)
2 Answers
Reset to default 2So after some thinking I came up with this:
Codex / Wordpress Versions has Changelogs, but these seem to mention (recent) database upgrades implicitly, starting at 5.0. (Compare how Matomo explicitly states DB upgrades). Maybe this will be enough for future versions, here's the thorough, cumbersome way that works for older versions, too:
- check
db_versionat Codex / Wordpress Versions, or manually/programmatically:- check
wp-includes/version.phpof the version we are updating from, 4.9.8:$wp_db_version = 38590; - repeat for version we are updating to; 5.0:
$wp_db_version = 43764;
- check
check
upgrade_allinwp-admin/includes/upgrade.php, for 4.9.8→5.0 / 38590→43764:// ... if ( $wp_current_db_version < 37965 ) // false upgrade_460(); if ( $wp_current_db_version < 43764 ) // true! upgrade_500();finally, inspecting
upgrade_500, reveals some Gutenberg-juggling and aFIXME:)- Conclusion: Only very minor database upgrades (one site option is set), so it should be fine, just keep an eye out for Gutenberg & Classic Editor plugin.
UPDATE/EDIT, regarding the "Background": So I did do a manual update 4.9.9→5.0 and then a manual downgrade 5.0→4.9.9 (4.9.8 and .9 don't differ DB-wise). I was presented with the "DB Upgrade required" screen both ways, and proceeded. What happens upon downgrade would need more research; my guess is that you only see the screen and none of the upgrade_* functions are executed. After up-and-downgrade everything looks normal, at least for this minimal, fresh install. So I will feel free to upgrade 4.9.8 to 5.0, knowing I can switch back should anything go wrong. YMMV, of course, especially when other plugins and themes are involved. Wouldn't do it for bigger version jumps, though :)
I upgraded 2 of my sites from version 4.9.8 to 5.0 and it did not require any database update. Also I had installed Gutenberg and the update disables the plugin since it's already integrated with the new version.
If you are concerned about the update, backup your database and site before the upgrading.
And where do I (reliably) look for this kind of information? I find myself googling for 'wordpress changelog' on every other update...
Background: usually I use a "skeletal" WP installation (seperate wp/app and wp-content folders), so I could try out the new major version and check for theme incompatibilites by "hotswapping" the wp folder. And I'm worried that "swapping back" might not work due to a migrated DB. Yes I know, I should always back it up before an update anyway. Question still stands :)
And where do I (reliably) look for this kind of information? I find myself googling for 'wordpress changelog' on every other update...
Background: usually I use a "skeletal" WP installation (seperate wp/app and wp-content folders), so I could try out the new major version and check for theme incompatibilites by "hotswapping" the wp folder. And I'm worried that "swapping back" might not work due to a migrated DB. Yes I know, I should always back it up before an update anyway. Question still stands :)
2 Answers
Reset to default 2So after some thinking I came up with this:
Codex / Wordpress Versions has Changelogs, but these seem to mention (recent) database upgrades implicitly, starting at 5.0. (Compare how Matomo explicitly states DB upgrades). Maybe this will be enough for future versions, here's the thorough, cumbersome way that works for older versions, too:
- check
db_versionat Codex / Wordpress Versions, or manually/programmatically:- check
wp-includes/version.phpof the version we are updating from, 4.9.8:$wp_db_version = 38590; - repeat for version we are updating to; 5.0:
$wp_db_version = 43764;
- check
check
upgrade_allinwp-admin/includes/upgrade.php, for 4.9.8→5.0 / 38590→43764:// ... if ( $wp_current_db_version < 37965 ) // false upgrade_460(); if ( $wp_current_db_version < 43764 ) // true! upgrade_500();finally, inspecting
upgrade_500, reveals some Gutenberg-juggling and aFIXME:)- Conclusion: Only very minor database upgrades (one site option is set), so it should be fine, just keep an eye out for Gutenberg & Classic Editor plugin.
UPDATE/EDIT, regarding the "Background": So I did do a manual update 4.9.9→5.0 and then a manual downgrade 5.0→4.9.9 (4.9.8 and .9 don't differ DB-wise). I was presented with the "DB Upgrade required" screen both ways, and proceeded. What happens upon downgrade would need more research; my guess is that you only see the screen and none of the upgrade_* functions are executed. After up-and-downgrade everything looks normal, at least for this minimal, fresh install. So I will feel free to upgrade 4.9.8 to 5.0, knowing I can switch back should anything go wrong. YMMV, of course, especially when other plugins and themes are involved. Wouldn't do it for bigger version jumps, though :)
I upgraded 2 of my sites from version 4.9.8 to 5.0 and it did not require any database update. Also I had installed Gutenberg and the update disables the plugin since it's already integrated with the new version.
If you are concerned about the update, backup your database and site before the upgrading.
本文标签:
版权声明:本文标题:upgrade - How to check if a core update, like 4.9.8 → 5.0, involves a database update (migration)? 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749103159a2316315.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论