EasyWPUpdate for WordPress 2.2 (and earlier)
Ξ May 15th, 2007 | → | ∇ An Uncategorized Post |
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!
on May 16th, 2007 at 3:05 am
[...] 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 [...]
on May 16th, 2007 at 2:24 pm
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
on May 16th, 2007 at 4:01 pm
Damn straight!
on May 16th, 2007 at 5:57 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!
on May 16th, 2007 at 6:07 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!
on May 16th, 2007 at 6:17 pm
I’m on 4.1.22-log
Whatever. It works!
on May 16th, 2007 at 6:50 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.
on May 16th, 2007 at 9:17 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.
on May 20th, 2007 at 12:50 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?
on May 20th, 2007 at 2:25 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/
on May 20th, 2007 at 4:56 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.
on May 20th, 2007 at 5:53 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.
on May 20th, 2007 at 9:15 pm
What? I thought I sent you the email. Well. That would explain a few things. Let me find where I put it.
on May 20th, 2007 at 10:10 pm
http://mostlynothing.info/code/webrunner
Thats the page.
on May 23rd, 2007 at 3:11 am
[...] 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 [...]
on May 23rd, 2007 at 12:19 pm
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’
?
on May 23rd, 2007 at 12:30 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.
on May 23rd, 2007 at 6:01 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.
on May 25th, 2007 at 11:22 am
[...] 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 [...]
on May 25th, 2007 at 12:14 pm
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.
on May 25th, 2007 at 1:07 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.
on May 25th, 2007 at 4:00 pm
Cool. Definitely a good thing to keep in mind. Thanks again.
on May 25th, 2007 at 8:26 pm
@Brian - Yeah, I agree.
Also, did you get the link?
on June 18th, 2007 at 3:38 pm
[...] EasyWPUpdate for Wordpress 2.2 and earlier - necessário acesso via Telnet [...]
on June 21st, 2007 at 4:01 am
[...] 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 [...]
on June 22nd, 2007 at 12:12 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 [...]
on June 27th, 2007 at 4:17 pm
[...] EasyWPUpdate for WordPress 2.2 (and earlier) Script for updating Wordpress…hmmm… (tags: wordpress script upgrade plugin) [...]
on July 7th, 2007 at 4:22 pm
Bug…
on August 6th, 2007 at 4:41 am
[...] 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 [...]
on September 8th, 2007 at 4:04 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 [...]
on October 25th, 2007 at 9:43 pm
Brian,
Any chance that this script might be tweaked for the 2.3 version of WordPress?
on October 27th, 2007 at 4:11 am
[...] 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 [...]
on October 27th, 2007 at 4:28 am
Rod - the script works for 2.3.x.
Well, it didn’t break anything for me, anyway.
on October 30th, 2007 at 1:16 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.
on October 30th, 2007 at 10:05 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.
on October 30th, 2007 at 12:27 pm
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.
on October 30th, 2007 at 2:45 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.
on November 20th, 2007 at 12:34 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 [...]
on December 30th, 2007 at 7:00 am
[...] it from the usual place, and mind-bogglingly quick and easy updates with Bryan Layman’s EasyWPUpdate [...]
on February 26th, 2008 at 10:37 am
[...] EasyWPUpdate というもので、 スクリプト冒頭にアップグレードするWordPress [...]
on March 10th, 2008 at 1:34 pm
Say, does 1and1 support fantastico and PHPmyadmin?
on March 13th, 2008 at 3: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.
on March 15th, 2008 at 9:22 pm
Okay, phpmyadmin was my main worry anyway.
Thanks!
on July 15th, 2008 at 3:13 am
[...] 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 [...]
on September 9th, 2008 at 2:11 am
[...] usual, Brian Layman’s EasyWPUpdate script made this a quick and easy update for [...]
on September 10th, 2008 at 2:29 am
Hello again! Just a suggestion, but you might consider calling each CPU-intensive activity with nice, and giving the user the option to set the value. It’s not particularly useful on a single-site host, but on a shared box it would be quite appropriate I think. Something like this perhaps:
NiceValue=”10″
…
(nice -n $NiceValue tar –no-recursion -zcf “$BackupDir/$BackupTarballName” . –recursion $SubDirs)
on December 11th, 2008 at 3:33 am
[...] That’s Bryan Layman’s EasyWPUpdate - could still be useful if you have a lot of sites to update, as it’ll do them in one easy [...]
on January 2nd, 2009 at 12:36 am
Love your post!! Finally someone got it right!!! Would you mind if I put a blogroll link back to your post?