Migrating Widget Settings in WordPress

一曲冷凌霜 提交于 2019-12-07 07:30:58

问题


I've done a lot of WordPress migrations from one server to another at work and elsewhere, but one strange thing I've never been able to understand is why widget settings never get carried over.

I'll dump the MySQL database, find/replace localhost with the live domain, SSH the database up to the live server, and then ftp the whole WP installation (core and theme, from my local machine), and still the widget settings are wiped out. And sometimes this is also the case with values saved in theme options pages I make in the Dashboard.

What am I missing?


回答1:


Wordpress stores widget options - and some plugins and themes also store their options - as serialized data, and so you have to be more careful than a full find/replace of the URLs.

Much more comprehensive answer and some other ways to do move databases and retain serialized data: https://wordpress.stackexchange.com/questions/9076/why-is-my-database-import-losing-text-widget-data




回答2:


To move a wordpress site and to reconvert all serialized data I used this script. the using is very simple, download the script, change the credential variable to the database inside the php script and run it.

link to download the script: http://davidcoveney.com/575/php-serialization-fix-for-wordpress-migrations/

work fine.




回答3:


Don't do it manually!

Dont edit database manually when migrating between different domains!
Use small scripts, like this: Wordpress-Migrator.php (read description too.)

because SERIALIZED arrays needs to be modified specifically too!!!



来源:https://stackoverflow.com/questions/6164831/migrating-widget-settings-in-wordpress

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!