Core upgrades

Check the core version

Run this command for your site:
wordshell mysite --list --core

You should receive an output something like this:
mysite   wordpress   3.3.2 (3.4.1)   WordPress Core

You can then chain standard UNIX commands to automate operations. e.g. To check all your sites and look for instances of version 3.3.1, do this:

wordshell all --list --core | grep 3.3.1

Or to list sites that are not running the latest version:
wordshell all --listupdates --core

Perform a core upgrade

WordShell upgrades WordPress core to the latest version by running the standard WP code. Therefore there should be no real difference between running the update via WordShell and running it via your admin panel – except that WordShell should be quicker and easier. The command to run is as follows:

wordshell mysite --core --latest

Note that the same advice applies as with any other WP update: you ought to first back up your database and content (though WordShell will take some backups for you – of your plugins whenever you work on plugins, of your themes whenever you work on themes, of core whenever you work on core).

If you are not changing to the latest version (e.g. you are downgrading, or rolling back), then WordShell cannot use WordPress’s internal procedures, but will perform a “manual” update instead (see http://codex.wordpress.org/Updating_WordPress#Manual_Update). This should work equally well, since WordPress internally does these same steps. e.g.

wordshell mysite --core --version=3.3.2 --donotrequirenew

or to recover from an upgrade that did not work, and roll back to WordShell’s most recent backup:

wordshell mysite --core --rollback

The same switches and options are available just as when working with plugins or themes, e.g.:

wordshell mysite --core --listrollbacks
wordshell mysite --core --rollback='2 days ago'
wordshell mysite --core --checkmodifications

However, whilst WordShell can do these things (e.g. maintaining patches, version control), note that it is not recommended to modify WordPress core at all. Rather, you should deploy plugins. It is the purpose of plugins to save you from modifying WordPress core and the version control issues that that can bring. However the above commands can still have some value for showing your version history and dates of updates (which you can also find in the WordShell log, ~/.wordshell/log).

Leave a Reply