I’ve done my fair share of migrating WordPress sites, but today I am completely and utterly stumped. I’ve worked for many hours on this, and I cannot find a solution. I hope someone here can help.
I have a site that I’m trying to migrate from my local testing server to www.mysite.com (not the actual URL). On the testing server, I have my hosts file set up so my site is located at www.mysite.cam. Therefore, I can do a find-and-replace on the database without messing up serialized data (because the string lengths are the same for both URLs).
I performed the usual migration routine:
1) Back everything up
2) Export testing server database to sql file.
3) Find and replace mysite.cam with mysite.com in the sql file.
4) Sync the remote directory in WinSCP
5) Import the sql file to the new database
Note: My wp-config.php file is host-independent, so it doesn’t need to be changed. I use $_SERVER[“HTTP_HOST”] to detect the host and use the right MySQL credentials.
When I try to access my site, I’ve lost the main navigation menu, as well as many of my plugin settings. It looks like serialized data got messed up in the wp-options table, but (as you can see from above), nothing did. I even tried using the WP Migrate DB plugin (which can handle serialized URLs) with the exact same results. I tried doing the migration multiple times, on different URLs, with no avail.
I also get some kind of database error from WP Super Cache the first time the site loads after being migrated. I tried disabling WP Super Cache, but it didn’t help any of the problems.
I could change the plugin settings that got messed up, but there are many plugins and many settings to change. Furthermore, I’m worried something else is broken that is not yet apparent.
Here’s some more info:
The local (testing) site works perfectly
The following plugins are installed: Comprehensive Google Map Plugin, jQuery Colorbox, Open external links in a new window, Post Types Order, Redirection, Use Google Libraries, WordPress Mobile Pack, WordPress SEO, WP-Migrate-DB, WP Super Cache (caching is currently turned off).
The testing sever uses WAMP on Windows 7
The testing server version is version-controlled using Git
The production server runs on GoDaddy Linux hosting
Files are being transferred via SFTP on WinSCP
I also tried regular FTP using FileZilla
Folks, I think I solved the problem! I switched the import file from UFT-8 to ANSI encoding, and the site appears to be working fine. I guess moving between Windows and Linux machines, encoding is really important. I’ve never had this problem before, but I will watch out for it in the future.
Instead of exporting the database why don’t you try to export an xml file from wordpress itself.
1) Go to Tools > Export and download the xml file.
2) setup a fresh wordpress install on your website.
3) Install the import plugin and go to Tools > Import.
4) if there are media files that cannot be uploaded from your localhost, try copying the uploads folder in wp-content directory in your new wordpress installation online.