Everyone loves WordPress – especially when it comes time to upgrade to the latest version of a plugin or of WordPress itself. You just click a button, and it does all the work.
Those of you who are used to doing things “The Joomla Way” can no doubt testify to the glory that is WordPress.
Sometimes, you can’t automatically update WordPress itself. In such cases, you need to manually install the newer version. Normally, you delete most of your old WordPress files (be sure to read the manual update instructions!), and then simply upload and uncompress the new version in your application’s directory. Voila! Everything just works…
Well, most of the time. Sometimes, it doesn’t. Sometimes, you are dumped back to the initial WordPress setup screen. If you fill in the fields and carry on with the install, it will look like you have just destroyed your entire old WordPress site when you are greeted with a default, empty home page.
Fortunately, you haven’t destroyed anything! Here’s how to get your site back in just 3 steps…
Step #1:
Back up your current database, just in case. You’re supposed to do this BEFORE the upgrade, but if you’re like me, sometimes you don’t. Now would be a good time to do a backup. If you’re using MySQL, just log in with phpMyAdmin and export the structure and data of all the WordPress tables into a SQL file. Stash it away somewhere safe!
Step #2:
Now that you have a backup of everything, you will probably note that you have 2 sets of tables. For example, you might have: wp_fji3s_posts
and wp_tfyr7_posts
. If you don’t, then you haven’t run the WordPress install again after being dumped to that page. Go ahead and fire away. When you’re done, look back in MySQL and you’ll see two sets of tables. What you need to do now is open up the file wp-config.php
in the root directory of your WordPress site. Search for: $table_prefix
All you have to do is change the table_prefix to point to your old tables. So, if you can see in phpMyAdmin that your old content is stored in wp_fji3s_posts
, but $table_prefix
is currently set to “wp_tfyr7_
“, just change that one line to look like this: $table_prefix = 'wp_fji3s_';
Save the wp-config.php
file and upload it to your server.
Step #3:
Check to see if your site is back up and running with your original content. It should be. At this point, all that is left is to delete the newly-generated tables in the database with the wrong prefix. In our example, you would drop all tables that begin with: wp_tfyr7_
That’s it.
I recently had this very problem with a backup version of this here site running on a local server, and I thought I had a lot of work ahead of me to restore everything. It turns out that the solution was to actually rerun the installation, which only modified the one $table_prefix
line in my wp-config.php
. After changing that back to the old prefix, everything worked great, and my WordPress update was complete.
So, even when things go wrong, WordPress still makes it uber-easy to set things right again.
Recent Comments