Successfully Recover from a Failed WordPress Update

WordPressWordPress is a great platform for blogging, building websites, and content management systems; and like any software creators have from time to time, released new versions in the form of automatic updates that need to be (or should be) installed. However, not all hosting servers run the same way when it comes to updating the software. Herein lies the potential problem for an automatic software update on the server to go awry.

That is exactly what happened to me yesterday when I went to update the WordPress software to the latest version. I saw that I had plugins to update; which I completed with no problems. However, when I tried to do a automatic update to WordPress, it got the proverbial message, “Update Failed.” That wouldn’t be so bad, except for one thing, I couldn’t log back in to my admin area. The blog was still active, but when trying to login to the admin area, I had the white screen of death, a blank page.

So, as luck would have it, or should I say Murphy’s law would have it, I did not have a recent backup of the blog. So, on to Google Search to find a WordPress update solution. I went looking to WordPress for an answer. I read on the forums of various instances of failed WordPress updates and the things to try. Many of the processes involved recovering from the update using the backup files. No, that was not going to work. Then I thought, maybe the manual WordPress installation procedure would work. I found this link for updating WordPress and thought maybe I could find how to do the process there.

Before doing anything, I decided to make sure I did a complete backup of everything that I could at that moment. I felt that the WP database was still intact on the website server. So, logging in to the CPanel of the website, I downloaded the various backups, including the databases that I had on the server. I also downloaded the WP directory from the server onto my local hard drive. I like using the FireFTP addon for Firefox. It is quick, easy to use, and convenient to provide FTP access for any website that you maintain.

After doing those things, I wanted some additional confirmation on the manual WP update procedure. I found this article on How to Recover from Failed WordPress Upgrade. The procedure was inline with the WP instructions, however, there were a few more details that made it easier to understand. Below is the procedure from WP. I am also adding my comments to it.

The following instructions assumes that you have your WordPress files installed in a separate directory on your web hosting account. Example would be: www.jimwarholic.com/blog or you might have the directory named wordpress or other instead of blog.

Step 1: Replace WordPress files

  1. Get the latest WordPress zip (or tar.gz) file. (I used the zip file and saved it on my computer hard drive).
  2. Unpack (unzip) the zip file that you downloaded.
  3. Delete the following two directories (inside your WP directory) on the web host using FTP or shell access (I used FireFTP):
    1. wp-includes
    2. wp-admin
  4. Upload the new wp-includes and wp-admin directories (directories are “folders” from the computer hard drive) to your web host in the WP directory. Because the old directories have been deleted from the web server, the new ones will take their place.
  5. Read this next step twice and follow it carefully. Upload the individual files from the new wp-content folder (located on your local computer hard drive) to your existing wp-content folder (on the web hosting server in the WP directory), overwriting existing files. Do NOT delete your existing wp-content folder. Do NOT delete any files or folders in your existing wp-content directory (except for the one being overwritten by new files). This will replace only the files that need to be replaced, but maintain the other files within the wp-content directory.
  6. Upload all new loose files from the root directory of the new version (located on your local computer hard drive) to your existing wordpress root directory on the web host.

NOTE – you should replace all the old WordPress files with the new ones in the wp-includes and wp-admin directories and sub-directories, and in the root directory (such as index.php, wp-login.php and so on). Don’t worry – your wp-config.php will be safe.

Be careful when you come to copying the wp-content directory. You should make sure that you only copy the files from inside this directory, rather than replacing your entire wp-content directory. This is where your themes and plugins live, so you will want to keep them. If you have customized the default or classic themes without renaming them, make sure not to overwrite those files, otherwise you will lose your changes. (Though you might want to compare them for new features or fixes..)

Lastly you should take a look at the wp-config-sample.php file, to see if any new settings have been introduced that you might want to add to your own wp-config.php.
Step 1.5: Remove .maintenance file

If you’re upgrading manually after a failed auto-upgrade, delete the file .maintenance from your WordPress directory using FTP. This will remove the “failed update” nag message.
Step 2: Update your installation

Visit your main WordPress admin page at /wp-admin. You may be asked to login again. If a database upgrade is necessary at this point, WordPress will detect it and give you a link to a URL like http://example.com/wordpress/wp-admin/upgrade.php. Follow that link and follow the instructions. This will update your database to be compatible with the latest code. You should do this as soon as possible after step 1.

In my case, when I logged back in (and I was able to log back in now), I was indeed prompted to update the database before continuing. All I had to do was click the link button and follow simple instructions to update the database.

Low and behold, success. Everything was back to normal, and actually seemed to be functioning better. I did have some further updates to do for the pluggins, but those went smoothly using the automatic update links for the plugins themselves.

Your email address will not be published. Required fields are marked *