I hadn’t experienced any problems upgrading WordPress in the past …until yesterday. Tried the automatic upgrade from version 2.8.1 to 2.8.3 and got a memory php error along the lines:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 228968 bytes)
The upgrade then terminated without installing. Tried googling this error and came up with a reasonable suggestion to change the memory limit on line 13 of wp-settings.php to 64M from 32M. After doing this, I retried the automatic upgrade and got an error along the lines:
Fatal error: Class ‘Translations’ not found in /home1/techandl/public_html/wp-includes/l10n.php on line 407
This time the situation was more serious. If I tried to access this website or my WordPress dashboard, I got this error message on a white screen with no way to access my website. I’m sure others trying to access the website got the same greeting. Thankfully, I had run the WordPress Database Backup plugin and saved my posts to my hard drive just before attempting the upgrade so I had my content safe.
‘So what next?’ I thought. Well I tried changing the memory limit back to 32M in wp-settings.php but this didn’t work. I then googled the phrase “Class ‘Translations’ not found in” and found that quite a few others had experienced the same problem when upgrading. Tried several suggestions before concluding that the best route was probably to downgrade WordPress back to version 2.8.1. This was a little daunting because, having not experienced any problems since the initial WordPress install last year, I was a little hazy on how to proceed. There isn’t an easy downgrade route, so I had to treat the whole thing as relearning the WordPress install.
Thankfully, there’s a reasonably good tutorial on the WordPress website. I only had to go to step 8 in the tutorial to downgrade the installation. Briefly:
- I backed up the complete website to my hard drive in case I messed up and had to retrieve some important deleted files.
- I downloaded WordPress version 2.8.1 from the Release Archive, then extracted the zip file to my hard drive.
- I deleted all the files in the root of the /public_html directory online (not the subfolders) except for .htaccess, wp-config.php and sitemap.xml and uploaded the equivalent files from the extracted zip file.
- I deleted the wp-admin folder online and uploaded the complete wp-admin folder from the extracted zip.
I then tried accessing this website and thankfully everything was now okay – I could see all my posts and the plugins were still activated.
So what have I learned here? Well, I now have a complete backup of my site on my hard drive which should help in downgrading a failed WordPress upgrade in future. But I shouldn’t have to downgrade a failed upgrade. The automatic upgrade should work and if it doesn’t, there should be an easier way to restore a previous version. I do have the WordPress Automatic Upgrade plugin installed which I used until WordPress included this feature. Perhaps I’ll go back to using that but I don’t know if it works with WordPress version 2.8.
Hope this will be useful to anyone in a similar situation. Have you had any problems with the WordPress automatic upgrade? Let me know in the comments.