I have several WordPress blogs, most of which are running out-of-date versions of WordPress just because of the hassle of updating them. I know the good folks at WP/Automattic make it pretty easy, but you still have to make a backup, FTP a ton of files up to your server without overwriting your theme, upload, or plugins directories, and run the upgrade script. It’s a hassle.
I have one blog running from Fantastico, and upgrading it is nice and easy. Two clicks and you have a backup of the old install along with your upgraded install. No problems to date. So I wanted to try to get Fantastico to upgrade my other WordPress sites where I installed it manually.
The only issue is waiting a little longer for Fantastico to provide the new version, and for my web hosts to provide the new version of Fantastico. But since I’m so slow at upgrading manually, even with some hyped up security issues, that seems like a lightning fast response time in comparison.
First I tested it all out with a test WP install.
Setup
I used 2.0.3 for the first test. The MySQL database and username are account_wptest1, so it’s not what Fantastico would have named them (it uses account_wrdp1). We’re running in a subdomain on one of my domains.
After installing WordPress, I made a few changes to the options (permalink structure, turned off outgoing pings and trackbacks, etc) just to give it a slightly lived-in feel. I also uploaded a new theme, and edited one the theme files a little bit so it’s not stock.
Then I posted an “ignore me, just testing” post. Everything looked good.
Examining Fantastico’s Data
Looking at my existing Fantastico WP install (installed to a subdomain), there’s a .fantasticodata directory off of the home directory, and a “WordPress” directory in that. Then each WP install from Fantastico has a file in that directory, that appears to be in the format domain.name|directory. Since cPanel subdomains are just directories off of public_html, that’s how they are set up. A Fantastico WP install in the root directory is named domain.name|
The file is a PHP file that looks like this:
< ?
$thisdb = "dbname"; $thisdomain = "domain.name"; $thisscriptpath = "/home/user/public_html/dir";
?>
The domain name is just the main blah.com name, even for the installs that are running off of subdomains. For the one that’s not in a subdomain, the script path is just “/home/user/public_html”. No sign of the MySQL database password in there.
Then in the WordPress install directory itself there’s a file called fantversion.php, which is another PHP file that gives the version of WordPress. For example:
< ?php
$version = '2.1' ;
?>
One of my existing installs has a fantastico_filelist.txt file, which looks like this:
wp-admin
wp-content
wp-includes
data.sql
fantversion.php
index.php
license.txt
readme.html
wp-atom.php
wp-blog-header.php
wp-comments-post.php
wp-commentsrss2.php
wp-config-sample.php
wp-config.php
wp-feed.php
wp-links-opml.php
wp-login.php
wp-mail.php
wp-pass.php
wp-rdf.php
wp-register.php
wp-rss.php
wp-rss2.php
wp-settings.php
wp-trackback.php
xmlrpc.php
The other install (the subdomain one) doesn’t have that.
Converting to Fantastico
Back to my new test install. I created a fantversion.php file that says that this was 2.0.3, which it is. Checked the Fantastico screen in cPanel just in case it had noticed, but it hasn’t found it.
2) Created the file in .fantasticodata, but left it empty for now. When I checked Fantastico, that empty file gave it the WordPress path, and that plus the version file was enough for it to think that there was a WordPress install for it to upgrade. I had a feeling it wouldn’t work without knowing the DB name, but then that file didn’t have the password anyway, so who knows… Can’t hurt, let’s click Upgrade and see what happens.
Hey! Victory! Easier upgrade than manually FTPing up all of the new files and going through the WordPress upgrade process, no matter how easy they make it. And now I have one-click upgrades for that WordPress install in the future. And, like with other Fantastico upgrades, it automatically created its own backup of the database and all the files in case something had gone wrong.
Time to go try it on some real blogs and cross my fingers. Actually, first I wanted to test it on a really old version of WordPress, since I still had a few blogs running — gasp — WordPress circa 1.5.2.
I downloaded 1.5.2 from wordpress.org (being very glad that they keep every old release available there), did all the same test installation stuff, and then tried the upgrade from Fantastico. No problems, 1.5.2 to 2.1.1 without any issues.
Real Blogs
Ok, on to the real blogs. For some I downloaded backups from cPanel first, for others I just took my chances and clicked Upgrade in Fantastico blindly. None of them had any issues.
Well, ok, one had one issue. This blog was running WordPress 2.0.3 with 159 posts, 147 comments, and 7 plugins enabled, though one plugin was a “2.0.3 tune-up” plugin for fixing some annoying bugs in 2.0.3. Disabled that plugin before upgrading, since those issues are supposedly all fixed by now without the plugin.
When I clicked upgrade, it sat there for a while and then eventually gave me a blank page. Hmm. That’s a little troubling. Nothing seemed to have been changed in Wordpress, though there was now a 6 MB file in the fantastico_backups directory. The web host that site was on went down about 15 seconds later for about 2 minutes. That’s not an unusual occurance, sadly enough, so it was probably unrelated to the stress of my upgrade attempt. I tried a second time when they came back up, and this time it finished successfully (after about 11 seconds of working), and with a 10MB backup file.
Another blog I tried was an unusual case. This one started its life as a Fantastico install about 2 years ago, but then I upgraded it manually because I didn’t trust upgrading from Fantastico; I had heard several horror stories about it back then. Now I’m going back to using Fantastico. So this install already had the appropriate file in .fantasticodata but an old fantversion.php file, and so Fantastico knew there was a WP install but thought it needed to upgrade it from 1.5, since that’s the last version I let Fantastico touch.
It was really 2.0.3, so I just edited fantversion.php (and deleted the fantastico_filelist.txt file that was there, since I don’t know what that is and it doesn’t seem necessary) and let it upgrade from that. That blog, with over 400 posts, took 21 seconds to do — probably mostly the backup — and had no problems. I just mention it because it was an unusual situation.
Hopefully this will help someone else. I figure if Fantastico ever does choke on an upgrade in the future, I can just do it manually at that point if I have to. The only difference is that version file and the pointer to the install directory, so after finding all that out I’m not worried about going back and forth between Fantastico upgrades and manual upgrades. But hopefully everything will keep working from Fantastico without going through all of that.
And now I’ll hopefully keep my Wordpresses more current.