0

I just did upgrade my wordpress subtree of my website to the 3.6 branch and now the site tells me that I need to upgrade my database as well:

Database Update Required

Nothing special so far, just business as normal. It suggests me to navigate to

http://example.com/wp-admin/upgrade.php?step=1

next.

As I'd like to automate the Wordpress Upgrade procedure a little from shell, I wonder how I can trigger executing the database upgrade from shell.

The information online is sparse and many are pointing to WP_Cli however I'm looking forward to an isolated command-line.

1

Since:

  1. upgrade endpoint in question doesn't seem to be behind login wall
  2. no user action is required other than visiting it

I would imagine requesting the suggested URL with some CLI tool for HTTP requests (curl and wget are commonly available) should accomplish upgrade.

  • I did this with curl, it eventually will also work by executing the file on the commandline directly, just fiddling with this. But so far +1 curl looks good. But as you write, some restrictions apply. – hakre Aug 18 '13 at 12:53
1

Core updates are supported in the WP-CLI.

wp core update - 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.

Other update commands include:

wp plugin update - Update one or more plugins.

wp theme update - Update one or more themes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.