How to update multiple WordPress installations in one swoop?

We’ll do that with the help of our friend the “cp” command and SSH access to our server.

You can find a good manual for all the switches at Tux Files or ask The Die, or simply try “cp –help” at the command prompt.

I use “cp” to update multiple installations of WordPress on the same server, whenever an upgrade is available.

Rather than hit the “upgrade”button in each back end, which will download and unpack the files for each installation, I only need to download the latest WordPress tarball once (it’s available at http://wordpress.org/latest.tar.gz or http://wordpress.org/latest.zip). I then make amendmends if and when I need them, and then cp the whole directory into all my installations.

Here’s the full command I use:

cp -r /tmp/wordpress/* /path/to/my/site

-r means I want to copy directories as well as files (recursively).

The trouble here is that I’m being asked each time if I really want to overwrite that one file – so we need to find a workaround there. The -f switch doesn’t do the trick, for reasons unbeknownest to me. Therefore, let’s look at Pipes. Since our answer is always YES (or y for short), we can put that in front of our command, and then execute it like so:

y | cp -r /tmp/wordpress/* path/to/my/site

You could even go a step further and write a shell script that’ll take care of all your installations for you.

Maybe we’ll cover that when I figured out how to do it.

Until then, enjoy 😉





Jay is the CEO and founder of WP Hosting, a boutique style managed WordPress hosting and support service. He has been working with Plesk since version 9 and is a qualified Parallels Automation Professional. In his spare time he likes to develop iOS apps and WordPress plugins, or draw on tablet devices. He blogs about his coding journey at http://wpguru.co.uk and http://pinkstone.co.uk.