我刚刚将我网站的wordpress子树升级到了3.6分支,现在网站告诉我,我也需要升级数据库:
需要更新数据库
到目前为止没有什么特别的,只是正常的业务。它建议我导航到
http://example.com/wp-admin/upgrade.php?step=1
下一步。
由于我想从shell自动化Wordpress升级过程,我想知道如何触发从shell执行数据库升级。
在线信息很少,很多都指向WP\\u Cli,但我期待一个独立的命令行。
SO网友:jgraup
中支持核心更新WP-CLI.
wp core update
- 更新WordPress。
# Update WordPress
$ wp core update
Updating to version 4.5.2 (en_US)...
Downloading update from https://downloads.wordpress.org/release/wordpress-4.5.2-no-content.zip...
Unpacking the update...
Cleaning up files...
No files found that need cleaned up
Success: WordPress updated successfully.
# Update WordPress to latest version of 3.8 release
$ wp core update --version=3.8 ../latest.zip
Updating to version 3.8 ()...
Unpacking the update...
Cleaning up files...
File removed: wp-admin/js/tags-box.js
...
File removed: wp-admin/js/updates.min.
377 files cleaned up
Success: WordPress updated successfully.
# Update WordPress to 3.1 forcefully
$ wp core update --version=3.1 --force
Updating to version 3.1 (en_US)...
Downloading update from https://wordpress.org/wordpress-3.1.zip...
Unpacking the update...
Warning: Failed to fetch checksums. Please cleanup files manually.
Success: WordPress updated successfully.
其他更新命令包括:
wp plugin update
- 更新一个或多个插件。
wp theme update
- 更新一个或多个主题。