Wordpress Site Migration- Menu links broken
I migrated a Wordpress site from Bluehost to my Linode using the plugin WP Migrate DB. This plugin is supposed to migrate the database in such a way as to preserve link relationships in the database on the new server, taking into account the new path for the document root. The homepage shows up, but when you click any link in either menu, it says "The requested URL was not found on this server." If I log into the admin area, all my pages and menus look ok, and the permalinks match. Yet you cannot navigate to anything but the homepage and admin login.
Bluehost is running:
Apache 2.2.34
PHP 5.4.24
MySQL 5.6.32-78.1
My Linode has:
Apache Apache/2.4.6 (CentOS)
PHP 5.4.16
MySQL Ver 14.14 Distrib 5.7.22, for Linux
4 Replies
This could be caused by some other problem and your database might be fine. In one instance I've found an issue like this to be caused by .htaccess rules, either a lack of them or by malformed rules. In your website's document root double-check that they exist (usually it's just a file called ".htaccess"), and if they don't exist try creating them. Here's a generally good example of WordPress specific rules to use:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
There could also be an incorrect directory reference in there if your directory structure is different on your Linode instance. If you see something like this in your .htaccess file, try reworking it to be in-line with the above example:
RewriteRule . ~/home/someuser/index.php [L]
If you'd like troubleshooting assistance with this you could also consider contracting out the Linode Professional Services team, of which I'm a member! We can be reached by hitting the "Get a Quote" button here:
In one instance I've found an issue like this to be caused by > >.htaccess rules
I checked, and my .htaccess rules are exactly as you specified in your example.
There could also be an incorrect directory reference in there if your > directory structure is different on your Linode instance
The WP Migrate DB plugin is designed to rewrite the database for the new file structure before export from the original site, so that when you import into the target site, all urls are correct. Out of curiosity, I tried creating a new menu and a new page from scratch, and I still get the error "The requested URL /test/ was not found on this server."
Here's error logs from Wordpress:
[10-Jul-2018 20:45:30 UTC] PHP Warning: mysqlirealconnect(): Headers and client library minor version mismatch. Headers:50556 Library:50637 in /var/www/html/flywithmark.net/publichtml/wp-includes/wp-db.php on line 1531
[10-Jul-2018 20:45:30 UTC] PHP Warning: mysqlirealconnect(): Headers and client library minor version mismatch. Headers:50556 Library:50637 in /var/www/html/flywithmark.net/publichtml/wp-includes/wp-db.php on line 1531
[10-Jul-2018 20:45:35 UTC] PHP Warning: mysqlirealconnect(): Headers and client library minor version mismatch. Headers:50556 Library:50637 in /var/www/html/flywithmark.net/publichtml/wp-includes/wp-db.php on line 1531
[10-Jul-2018 20:45:38 UTC] PHP Warning: mysqlirealconnect(): Headers and client library minor version mismatch. Headers:50556 Library:50637 in /var/www/html/flywithmark.net/publichtml/wp-includes/wp-db.php on line 1531
[10-Jul-2018 20:45:40 UTC] PHP Warning: mysqlirealconnect(): Headers and client library minor version mismatch. Headers:50556 Library:50637 in /var/www/html/flywithmark.net/publichtml/wp-includes/wp-db.php on line 1531
[10-Jul-2018 20:45:42 UTC] PHP Warning: mysqlirealconnect(): Headers and client library minor version mismatch. Headers:50556 Library:50637 in /var/www/html/flywithmark.net/publichtml/wp-includes/wp-db.php on line 1531
[10-Jul-2018 20:45:45 UTC] PHP Warning: mysqlirealconnect(): Headers and client library minor version mismatch. Headers:50556 Library:50637 in /var/www/html/flywithmark.net/publichtml/wp-includes/wp-db.php on line 1531
[10-Jul-2018 20:46:13 UTC] PHP Warning: mysqlirealconnect(): Headers and client library minor version mismatch. Headers:50556 Library:50637 in /var/www/html/flywithmark.net/publichtml/wp-includes/wp-db.php on line 1531
Those are only soft warnings and don't seem to indicate an actual issue. If WordPress couldn't actually connect to your database it would fail more completely.
Can you try "resetting" your permalink structure?
Any difference in the WordPress versions between the servers?
Do you see any other errors in your Apache error log?
Can you show me the Apache virtualhost configuration you have on both Bluehost and Linode?