EasyWPUpdate for WordPress 2.2 (and earlier)
The release of WordPress 2.2 is finaly at our doorstep. You can find the download on the on the main download page here: http://wordpress.org/download/ or from the announcement here: http://wordpress.org/development/2007/05/wordpress-22/. This has been an interesting release. For the last month I’ve been concentrating on the new job, but in the middle of all that I did participate in the debate that ended with the original tag implementation being pulled from this release. Matt M. showed some real maturity by being willing to step back from his implementation upon the recomendation of others. Oh! and for info about the name of this release “Getz” head on over to Matt’s site for some sweet tones to put you into the mood to upgrade…
Aaron Brazell, aka Mr. Boss Sir, has come through and delivered another one of his 10 Things You Should Know About WordPress 2.2 articles and does a pretty good job of describing the heart and soul of this release.
I’ve released an updated version of my EasyWPUpdate script which includes some of the suggestions I’ve had from my readers. Now, I must admit that Aaron’s similar script is downright awesome and the absolute best script in the world (yes I must admit that because it was a condition of my employment with b5media (REALLY!)), but if you don’t have automated server backups and you don’t regularly backup your SQL files, you might want to try my lowly little script.
Its features include:
- Many blogs in one shot
- Any version of WP
- Automaticly runs upgrade script
- Cleans up all files
- Can use hosted or local files as source
- Can be croned to ensure backups and/or refresh of dirtied files
- Backup of files to new directory
- Backup of files tarball/li>
- Backup of database to SQL text file
- Backup of database to tar ball
- Optional inclusion/exclusions of directories.
- Error detection and safe aborts
You can peruse the text version, EasyWPUpdate.txt, here:
Here are the basic steps to install this script:
1. Use Telnet or Putty to connect to your website and log into the shell
2. Type the following line:
wget http://www.thecodecave.com/downloads/EasyWPUpdate
3. Type the following line:
chmod +x EasyWPUpdate
4. Use an editor to change the values in Step 1 and save it again.
5. Run the script by typing:
EasyWPUpdate
That’s it. You will have just made backups of the files and database and updated all of your blogs. When 2.2.1 or even 2.3 comes out, the process will be:
1. Log in
2. Type
EasyWPUpdate
And you are done.
Now, step 1 looks like this:
# ##################################################################
# Step 1. Tell the script where to find the blogs
# ##################################################################
# List all of your WordPress directories and urls here.
#
# Each Blog should have a BlogDir and a BlugURL.
# Each Blog should have its own number [1],[2],[3] etc
# Delete the ones you don’t need.
#
BlogDir[1]=’site1dir’
BlogURL[1]=’www.example.com’
BlogDir[2]=’site2/news’
BlogURL[2]=’www.site2.com/news’
BlogDir[3]=’wordpress’
BlogURL[3]=’blog.site3.com’
That isn’t that hard to change is it? Even in VI.
Some quick tips on editing the script
1. type
vi EasyWPUpdate
2. Hit i
3. Make your changes
4. Hit ESCAPE COLON W to save your changes (or skip this step to lose changes)
5. Hit ESCAPE COLON !Q to immediately quit
Also, if your root directory is accessible from the web, you might want to change the name of the script:
mv EasyWPUpdate SomeSneakyName
to prevent unauthorized access.
(If you are a guru, please read through all 6 setup steps (and the rest too) there may be things you want to change.)
Enjoy 2.2!
















[...] for a friend or two. As is my standard practice now, I used Bryan Layman’s totally spiffy EasyWPUpdate script, which does all the backing up, downloading files and even does the equivalent of clicking the [...]
Pingback by WordPress 2.2 Has Landed : Losing it[1] — May 16, 2007 @ 3:05 am
Hi there. A *terrific* script, and it’s got me all very excited about the ease with which I can upgrade. But I have a problem
Making Targeted Database Backups...Processing SQL Backup for: webs/the/path/tomysite
mysql: unknown variable 'protocol=TCP'
Could not retrieve table names. SQLBackup failed.
MySQL’s on a different machine…but it should know this, right, by finding the server name from WP’s config file? Incidentally I’m running the script by doing “perl EasyWPUpdate” if that makes any difference
Any clues?
Thanks Brian!
Will
Comment by Will — May 16, 2007 @ 2:24 pm
Damn straight!
Comment by Aaron Brazell — May 16, 2007 @ 4:01 pm
Removing the protocol=tcp parameter has done the job! What a brilliant script. Two blogs upgraded, one 50mb database and a whole load of files backed up in about 15 seconds. Seriously impressed and very grateful!
Comment by Will — May 16, 2007 @ 5:57 pm
HUH! Do you know what version of MySQL you use? If you only removed that, I don’t think you are communicating via named pipes or sockets. So maybe it is an older/custom version that communicates ONLY through TCPIP
Anyway, Glad you got it to work!
Comment by Brian — May 16, 2007 @ 6:07 pm
I’m on 4.1.22-log
Whatever. It works!
Comment by Will — May 16, 2007 @ 6:17 pm
This is the best scipt I’ve seen so far.
But what about my WebRunner? You said you’d be including a link. Anyway I’m updating right now.
Comment by Joe — May 16, 2007 @ 6:50 pm
Actually I was wondering the same thing, I thought we’d left it so that you were going to post it and I would link to it, If you want to do it the other way around, just send me the latest.
Comment by Brian — May 16, 2007 @ 9:17 pm
Sorry if these are stupid questions — I haven’t used Putty and the shell for much…
I’ve followed your steps above, using PuTTY, but when is comes time to run the script, I get the following:
-bash: EasyWPUpdate: command not foundAlso, if the WP blog is in the root/main folder of the site (i.e., http://www.somesite.com), what value do you set for the BlogDir?
Comment by Eric — May 20, 2007 @ 12:50 pm
I found the answer to my first question, by using:
./EasyWPUpdateStill not sure what to put for BlogDir, though. Is it the file path? e.g., /home/some/dir/public_html/
Comment by Eric — May 20, 2007 @ 2:25 pm
If you only have one blog, you should just put the value as
BlogDir[1]=.
and that should do it for you!
That’ll just tell the script to run out of the current directory.
Comment by Brian — May 20, 2007 @ 4:56 pm
Brilliant, thanks! I hate updating WP, but was able to update 7 blogs today using the script. Seems to have worked like a charm.
Comment by Eric — May 20, 2007 @ 5:53 pm
What? I thought I sent you the email. Well. That would explain a few things. Let me find where I put it.
Comment by Joe — May 20, 2007 @ 9:15 pm
http://mostlynothing.info/code/webrunner
Thats the page.
Comment by Joe — May 20, 2007 @ 10:10 pm
[...] or they can take attacks seriously, use tools that assist in upgrading (Brian’s upgrade script is very good too) and be done very quickly and [...]
Pingback by Guide to Disaster: How The Tech Team Handled WordPress Security Flaw — May 23, 2007 @ 3:11 am
This looks really cool but I don’t really understand step 4.
I’m supposed to enter a me-relevant version of
BlogDir[1]=’site1dir’
BlogURL[1]=’www.example.com’
BlogDir[2]=’site2/news’
BlogURL[2]=’www.site2.com/news’
BlogDir[3]=’wordpress’
BlogURL[3]=’blog.site3.com’
?
Comment by James Joyner — May 23, 2007 @ 12:19 pm
James,
If you have 2 blogs to upgrade, one in your website root and the second in a folder under your website root called sports, for instance, you’d run the script from your website root and do:
BlogDir[1]=’.’
BlogURL[1]=’www.outsidethebeltway.com’
BlogDir[2]=’sports’
BlogURL[2]=’www.outsidethebetlway.com/sports’
Similar to that anyway. I’m assuming some information on what you’re hoping to upgrade, but that’s what I’d venture.
Comment by Aaron Brazell — May 23, 2007 @ 12:30 pm
Brian - thanks very much for this script. I’ve got two separate blogs on my server, and while the main one was current (2.2), the other was on 2.1.3. Until I tried the script, and after a little tweaking, it upgraded perfectly. Now I’ve got both configured for the next upgrade. Very much appreciated.
Comment by Rod — May 23, 2007 @ 6:01 pm
[...] under 30 minutes. Brian makes the script (or maybe a stripped down version of it - not sure) available on his site, and I used it to upgrade canucknation.ca from 2.1.3 to 2.2 in about 20 seconds. I’ve [...]
Pingback by rodtempleton.net » Upgrading to WordPress 2.2 should be mandatory — May 25, 2007 @ 11:22 am
I was wondering if it’s necessary to disable all of the installed plugins before running the script? I did on the first upgrade I ran with the script, but if it’s not necessary, I’ll skip it the next time I run it.
Comment by Rod — May 25, 2007 @ 12:14 pm
No, it is not. That is something that 2.0 gave us. The plugin API eliminates most of the need. There is a SMALL chance that a plugin would be completely inoperable and stop an upgraded site, but on the very rare event that happens, you can go into PHP my admin to the options table, sort by option name and delete the the option value for “ActivePlugins” which should be at the top of the list. I asked the members of WP-Hackers and WP-Testers if they deactivated plugins before upgrading and every one that replied said they never did. Not one person spoke up for de-activating the plugins.
Comment by Brian — May 25, 2007 @ 1:07 pm
Cool. Definitely a good thing to keep in mind. Thanks again.
Comment by Rod — May 25, 2007 @ 4:00 pm
@Brian - Yeah, I agree.
Also, did you get the link?
Comment by Joe — May 25, 2007 @ 8:26 pm
[...] EasyWPUpdate for Wordpress 2.2 and earlier - necessário acesso via Telnet [...]
Pingback by - - - - W i l s o n - - - - » Blog Archive » Fazer o backup do wordpress — June 18, 2007 @ 3:38 pm
[...] usual, I upgraded using Bryan Layman’s remarkably painless latest version of WPEasyUpdate. If you have shell access, this has to be the best way to get your WordPress up to the latest [...]
Pingback by WordPress 2.2.1 is out : Losing it[1] — June 21, 2007 @ 4:01 am
[...] you’re comfortable with shell and a bit of script modifying you definitely want to check out Brian Layman’s EasyWPUpdate script. I just updated 4 blogs on one server in less than 5 minutes — and that includes full [...]
Pingback by WordPress 2.2.1 » Solo Technology — June 22, 2007 @ 12:12 am
[...] EasyWPUpdate for WordPress 2.2 (and earlier) Script for updating Wordpress…hmmm… (tags: wordpress script upgrade plugin) [...]
Pingback by » links for 2007-06-27 » MY Vast Right Wing Conspiracy — June 27, 2007 @ 4:17 pm
Bug…
Comment by Joe — July 7, 2007 @ 4:22 pm
[...] with shell access can do it in seconds with the help of Bryan Layman’s really quite lovely EasyWPUpdate script, which is my standard method for keeping Losing it[1] up to [...]
Pingback by WordPress Security Updates : Losing it[1] — August 6, 2007 @ 4:41 am
[...] with shell access can upgrade in seconds with the help of Bryan Layman’s really quite lovely EasyWPUpdate script, which is my standard method for keeping Losing it[1] up to [...]
Pingback by WordPress 2.2.3 is out : Losing it[1] — September 8, 2007 @ 4:04 am
Brian,
Any chance that this script might be tweaked for the 2.3 version of WordPress?
Comment by Rod Templeton — October 25, 2007 @ 9:43 pm
[...] Especially if you use Brian Layman’s EasyWPUpdate script, which did it in seconds for me… You can post a comment or leave a trackback from [...]
Pingback by WordPress 2.3.1 is out : Losing it[1] — October 27, 2007 @ 4:11 am
Rod - the script works for 2.3.x.
Well, it didn’t break anything for me, anyway.
Comment by Les — October 27, 2007 @ 4:28 am
Yep, it is tested and working well.
Now that I know a good bit more about scripting than I ever had before, I will be doing an update of this script.
The WordPress installation process has come a ways, but because this script does the whole procedure of backing up both files AND database, it still has place.
I get a lot of comfort out of knowing that all of my sites are backed up and cleaned on a regular basis.
Comment by Brian — October 30, 2007 @ 1:16 am
Brian - keep up the good work with this script. At last count I’m using your script to keep 26 sites current. To say the least, I am deeply grateful for your script. Thank you.
Comment by Kevin — October 30, 2007 @ 10:05 am
Weird. I get the following error :
cp: cannot open `/home/rod/public_html/wp-content/rtdn-backup/2007-09-25-08-20-34-full.tar.gz’ for reading: Permission denied
This started with the upgrade to 2.3, and while that .gz file exists, I cannot change its mode (currently 600) or delete it. Permission denied to do either.
Comment by Rod — October 30, 2007 @ 12:27 pm
Actually it appears to have been a permission issue on my server. Not something I’d changed, but with the permissions set the correct way, the script runs fine again.
Comment by Rod — October 30, 2007 @ 2:45 pm
[...] code for the script is available on Brian’s site, and it’s really as simple as editing it with the URL and directory where your blog is [...]
Pingback by Backup and Update a WordPress Blog in Under 12 Seconds — November 20, 2007 @ 12:34 pm
[...] it from the usual place, and mind-bogglingly quick and easy updates with Bryan Layman’s EasyWPUpdate [...]
Pingback by WordPress 2.3.2 is out : Losing it[1] — December 30, 2007 @ 7:00 am
[...] EasyWPUpdate というもので、 スクリプト冒頭にアップグレードするWordPress [...]
Pingback by わーどぷれすっ! » アップグレードをどうするか? — February 26, 2008 @ 10:37 am
Say, does 1and1 support fantastico and PHPmyadmin?
Comment by steve — March 10, 2008 @ 1:34 pm
It supports phpmyadmin. It comes with it but I have my own preferred flavor installed.
Fantastico I think requires cPanel which 1and1 doesn’t run. So I think the answer is no.
Comment by Brian — March 13, 2008 @ 3:34 pm
Okay, phpmyadmin was my main worry anyway.
Thanks!
Comment by steve — March 15, 2008 @ 9:22 pm
[...] that was painless. As always, I used Bryan Layman’s EasyWPUpdate script, after being a Good Boy and deactivating all my plugins first[1]. Reactivating all my [...]
Pingback by Updated! : Losing it[1] — July 15, 2008 @ 3:13 am