Okay, at last found that, the serialized data, where there is a site_url exists, are causing the problem while I’m migrating the data from localhost to server replacing the local URL to server URL.
I found two solution, both are not tested yet:
- PHP Serialization Fix for WordPress Migrations (& other applications like Expression Engine) by David Coveney
- Fix-Serialization (Script to fix length attributes in serialized strings) – by Pau Iglesias
Need not to say that, try them with your own risk.
EDIT
BEFORE EVERYTHING
BACK UP YOUR DATABASE FIRST
Okay, I found the first one only specific to options
table and not much flexible and not reliable too (WTFLicensed :p ). So I went with the second one by Pau Iglesias.
I found it working just fine. But as I’m a Windows user, couldn’t use shell script, so I forked his repo and made my own way using the same script:
- serialization-fixer – Raw PHP way – github
Using my one is a bit sever-specific. You will need to put your exported string-replaced .sql
file into the same folder where the serialization-fixer.php
is. Then you need to open the file and change line#21 with your .sql
file’s filename. After then you can simply run the file from your browser.
Thanks to Pau Iglesias for his nice scripts.