..Upgrade from Wordpress 2.5 to 2.6
Wanting to help someone learn about how to upgrade, and to help the owner of a Wordpress site, I figured Sunday was a good day to go from an old Wordpress version to a newer one. I had done tens of hundreds of similar upgrades but none of that mattered as I failed miserably.
Here's how it normally goes when upgrading a content management system, including Wordpress:
- Backup the site
- Copy over the new files
- Run an upgrade script
- Test it
The bulk of the time is usually #2, waiting for files to copy. In the case of 2.6.1 of Wordpress, that's about 564 files in 74 directories, just over 4 megs of data. Even at a slow WiFi cafe, that's maybe 15 minutes.
After doing the backup, something caught my eye. A shortcut! I love shortcuts. Who could resist?
After a quick click, the home page of the site was looking good which meant I was 99% done. I just needed to confirm the backend (admin) part was good-to-go. It was horribly not ready: I had encountered the often feared Wordpress white-screen-of-death:
Fatal error: Allowed memory size of 8388608 bytes exhausted
(tried to allocate 77824 bytes) on .../template.php on line 498
Fatal PHP errors. Big deal. They sound scary, but stuff like this is usually something simple. Seriously, an extra space at the end of a config file can make things ugly, fast. I rolled up the sleeves and took a look at the file that was complaining: template.php.
Seriously. This is how template.php begins. This is the hello to all those who may venture in searching for a clue. No official Wordpress header telling who wrote it, the type of license, where to go to report bugs.
Big mess and ugly.
When the source code of the software you're trying to fix begins with someone saying it's a big mess, and ugly... that's your cue to look elsewhere for a solution.
Ok, fine. Forget template.php. Forget this fatal memory stuff. I'm comfortable admitting I can't solve this via line 498. So what's next? What I should have done first: Ask Google.
33,000+ refereneces to "fatal error" and Wordpress. Hmmm. I'm thinking I'm not the first one to stumble into this briar patch. Looks like these guys might have already gone down this road.
Ok. Fine. No problem. I hosed the site. I've done that before. Not all that terrible. Restore from backup. Problem was likely that quickie shortcut Fantastico thing. I should have gone from 2.5 to 2.6.1... After 20 minutes of copying and cursing, WP 2.5 was back. ahhh
Now to do it correctly: I'll do the upgrade from 2.5 to 2.6.1 ... but manually this time. After another half hour of copying files, I had trashed the site again. Same error, same template.php file, just a different number of bytes.
Ugh.
So ... back to 2.5 we went, for the second time, which is where it sits today.
My moral of the story:
If you're thinking about running your own Wordpress site, be aware that upgrades are required on a regular basis but just because they release a new one doesn't mean it's better than what you have.
Google before you start the upgrade.
Make sure the person/company that does the original install will be available for upgrades. Don't assume that links like "Click here to upgrade" work.
Before you decide to venture off to toil in your own Wordpress garden, make sure you have fully embraced and understand ActiveRain. Consider AR as must-have training. Once you master all of what's here, then consider building your own.
Searching for solutions to fatal memory errors is no way to spend a Sunday afternoon.
PS. I'm pretty sure I know what the problem is ... and will post what I find later this week when I get around to testing my hunch.
Comments(3)