Categories: Web Stuff

Common WP problems after server migration and how to fix them

I really want to write about this before, but I dont’ seem to have that “eagerness” to write about what I’m going to write about now. Since the first time I migrated my blog to another server 6 years ago, I encountered a lot of technical problems. I even forgot most of it. Soooo… what I’m going to do now is to write about the common problems and solutions that I encountered each and every time I migrate to a different server, so that it will help others who will encounter such.

These problems are commonly encountered when migrating WordPress and other dynamic database-driven websites. But I’ll only be sharing about the common problems in migrating WordPress sites, because I haven’t encountered any problems when migrating a static HTML page and I haven’t tried migrating other CMS aside from WordPress.

500 Internal Server Error – the most common problem that I encountered when transferring a WP blog from one server to another server is this error. The easiest way to fix it is to empty your .htaccess file, then proceed directly to your wp-admin. Go to Settings > Permalinks > tick Default > Save Changes. After saving the changes, you can revert to your custom permalink structure again. If you can’t access wp-admin after you emptied your .htaccess file, just copy and paste the mod rewrite rules below and that should fix the problem.


RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]


If that didn’t help, please leave a comment in this post so that I can help you trace the problem and fix it. Haha!

The Blank White Page – commonly known as the white screen of death, inspired by the good old Windows blue screen of death. Yay! I’m really not sure what’s the root cause of this error. Common reasons why you encounter an empty white page is the file permissions. For instance, you’re from a server that uses a mod_php (dso) handler, then you transferred to a server that uses suPHP, you’ll surely encounter permission errors. You need to CHMOD your files to 644 and folders to 755. After you changed the permissions, this will surely fix your problem. If you’re not familiar about php handlers, here’s a very helpful post to get you started.

If changing of file and folder permissions didn’t help you fix your blank white page problem, maybe your source code is empty, that’s why it’s showing a blank white page. This happens when you transfer a file via FTP and the transfer times out. The file transfer didn’t complete, that’s why your source code is empty. Or… you have WP-Cache installed and it went nuts. Just delete all your cached files and see if that fixes the problem.

Another reason of an empty white page is your wp-config. If there’s an empty line after the end of the code, then that’s the culprit. You can read a detailed post about it here. You should remove all empty lines in your wp-config.php and that should fix the blank white page dilemma.

Is its parent directory writable by the server error – this is a pretty familiar error if you transfer from a server that doesn’t use cPanel to a server with cPanel. This is common if you migrate from Dreamhost to any other webhost and vice versa. You’ll just notice this error after uploading an image to your post. Once you selected an image to upload, this error will occur:


"Unable to create directory /home/yourusername/wp-content/uploads/year/month. Is its parent directory writable by the server?"


This error is pretty easy to fix. The first thing that you should do is go to Settings > Media and replace the current directory in “Store uploads in this folder” input field to wp-content/uploads. That should quickly fix your problem. If it didn’t help, you need to change your file permission to 777 (which is not recommend as your folder will be very vulnerable to hackers) if you’re using mod_php and 755 if you’re using suPHP. I’m pretty sure you’ll never modify the permissions if you encounter this problem as the first solution above will definitely work.

Call to undefined function: wp_cache_init – this error happen sometimes when you have a caching plugin installed in your WordPress. After you transfer your WP blog to another server, there’s a slight chance that you’ll encounter a cache error. If you did, just delete your quickcache, wp-supercache or w3totalcache plugin folders (including the PHP cache files inside wp-content that is part of the plugin). After deleting those, this error will most likely be fixed.

If that solution didn’t help, your last resort is to do a fresh WP install in a separate folder then copy your wp-content and wp-config.php to the folder where you uploaded your latest WordPress files. That will surely fix the problem.

Redirected to yourdomain/wp-admin/install.php after transfer – this error is also common when you recently transferred to a brand new server. It’s not really an error, you just forgot to import your database. But if you already imported your MySQL database to the new server, then something must be really wrong. I recently encountered this a while ago while transferring from my old dedicated server to a new dedicated server. I was shocked that the contents of my database was gone and I was redirected to the WordPress install page.

I then checked my database inside phpmyadmin and it was there. The tables are also there, but it’s all empty. I asked my host to re-dump my MySQL database from the old server and import it again to the new server. But that didn’t help.

After a few minutes of being shocked and panicked, the database was successfully recovered. The problem is with the permission of the .FRM files. These are the files where MySQL stores its data. After the permissions were fixed, the problem was solved.

I think that’s all for now. I’ll be adding more WordPress problems after server transfer if I encounter a new one in my future migration adventures! Haha!

Error: Incorrect information in file: *.FRM – this is a rare problem and only occurs if you have a failing or dying hard drive. Right after you migrated your WordPress blog and you tried logging in to wp-admin, you’ll be redirect to this page: yourdomain/wp-admin/maint/repair.php?referrer=is_blog_installed. Your database or some tables in your MySQL database is corrupted and you need to repair it. In rare instances, it cannot be repaired. But most of the time, it’s repairable.

If you’re one of the few unlucky WordPress blog owners who encountered the “rare instances” that I’m talking about, don’t lose hope. I encountered this problem many times before. Here’s an example of the error in wp_users (or any other table inside a WP database) that you might have encountered as well after attempting to repair your database:

The wp_users table is not okay. It is reporting the following error: Incorrect information in file: './your/database/directory/wp_users.frm'. WordPress will attempt to repair this table…
Failed to repair the wp_users table. Error: Incorrect information in file: './your/database/directory/wp_users.frm'


If you encountered the same exact problem as I did, then all you need to do is copy the .FRM, .MYD, and .MYI files inside your /var/lib/mysql directory from your server. You need root access to access it. Install XAMPP or AppServ in your computer and copy the data to your database directory, then open it locally via phpmyadmin. There’s a great chance that you can still recover your data and create a dumpfile.

If you still can’t recover it, then I don’t know what else to do. If you do know, please share it below. Yay!

PS: If you encountered any problems during a recent server migration, please feel free to share it below.

jehzlau

I'm a newbie web developer

View Comments

Share
Published by
jehzlau

Recent Posts

Convert your WordPress blog into a mobile app for free

If you're already an expert in "Progressive Web Apps" and you already have a mobile…

April 7, 2018

Philippines ranked 5th in Bitcoin volume by currency

Yep, you read it right. The Philippine currency (PHP / Pesos) ranked 5th in the…

November 3, 2017

Where to withdraw your Bitcoins in PH after the SegWit2x Hard Fork this November?

If you're using Coins.ph to convert your BTC to Philippine Pesos like me, then you…

October 22, 2017

Poloniex 101: Newbie’s Guide to Buying and Selling Cryptos in Poloniex

If you're already trading cryptos, then this post is NOT for you. This is a…

August 30, 2017

Why you should NOT buy Bitcoins from Coins.ph

I love Coins.ph, it's convenient to buy mobile load, pay bills, and to send cash…

May 23, 2017

Buy Ethereum’s ETH/ether in the Philippines

February 1, 2018 UPDATE The ETH wallet in the coins.ph Android app is now open…

May 1, 2017