THIS ARTICLE IS OUT DATED. Please see: http://www.TheCodeCave.com/EasyWPUpdate for the current release.
Well I’ve upgraded the 35 Second upgrade script significantly for this release.
Here’s a summary of the new features:
- Customizable options at the top of the script
- Works for unlimited numbers of blogs with just updating the header
- Optionally performs Web update steps as well
- Optionally performs backups of all WP related files
- DISABLED: Performs a Database Backup
- Backups are to a directory of your choosing suffixed with “today’s” date
- Can now upgrade blogs in a WordPress directory or any other
- Respects the tmp directory on your server
- Can be modified to perform nightly refresh of all blogs from a local tarball
- Can be customized to retrieve beta releases
- Can be customized to retrieve from WP.org’s archive folder
This hasn’t had a lot of testing yet outside of my blogs, but it has worked BEAUTIFULLY for me and as you can see I am running Version 2.0.6 thanks to spending 5 seconds this morning to update all of my blogs.
Here is the text to download: (link)
Perhaps the easiest way to get the file is to telnet into your account and run this line:
wget http://www.thecodecave.com/downloads/tcc_wp_upgrade
Then give yourself execute permissions on the script, choose your own or run this:
chmod +x tcc_wp_upgrade
If you get errors, remember that you might be dealing with passing the script through Windows and may have tacked on an extra CR at then end of each line… You should be able to fix that by using an SED command something like this
tr -d ‘\r’ tcc_wp_upgrade > xx && mv -f xx tcc_wp_upgrade
(Thanks to Prec on FreeNode #SED)
Then edit the file to your specifications using VI or whatever. I use NetDrive to make my website Drive X on all of my machines and then use Notepad2.exe to edit it and enforce the Unix line endings.
Right now I REALLY would like to have only proficient people run this script. It has only been tested on my sites.
This script messes with your files. If something really horrible goes wrong, you could lose information. I’ve done my best to ensure this doesn’t happen, but literally everything I know about bash I learned in the last month writing this script. A good programmer can go from any language to any language with relative ease (and bash IS a language), but we can’t know everything about how it works on all systems. That only comes with experience.
So I’ve got a bigggg scary message at the front of the script. It’s scarier than it needs to be, or I wouldn’t have the confidence to release the script at all. But it spells out in no uncertain terms the risks of running ANY unfamiliar script (not just mine) on your active site :
# Indemnity –
# Use this file at your own risk. I’m not going to deliberately hack
# your server, but others might. This is a shell script. Very bad
# things can happen. I am relatively new to *nix scripts. So
# I’ve had others review this script. But NONE of this guarantees
# things won’t go wrong or that this script is unchanged. Only
# use this script IF you’ve gotten it from TheCodeCave.com or another
# site you trust.
#
# THIS SCRIPT SHOULD BE USED AT YOUR OWN RISK. It can erase hours of
# hard work put into your site. Before using this script it is
# required that you review and understand every line and vouch for
# its safety. If you are not comfortable with this, don’t run this
# script. I have one host that I can test this on. Only you can say
# that this script will not do irreparable harm to your host if you
# use it.
#
# YOU are responsible for YOUR site. Learn how to protected it and
# understand what every line of code does before you call it.
When you run this script, please come back here and report your results.
Thanks!
Here’s the source for those that want to see it online:
Continue reading Upgrade your WordPress sites in 5 Seconds