admin管理员组文章数量:1393367
At the moment my current workflow looks like this.
I will take the latest copy of WordPress and its database from the live server and develop it using MAMP on my machine.
On my local server I will make my changes. For example, I might add a new custom post type and some custom fields using the Custom Post Type UI and Advanced Custom Fields Plugins. Then I would code a custom post type template. After that I will change the settings in my wp-config.php, upload the whole WordPress directory to the live server (which takes ages) and do a search and replace on the database.
What if someone has created new posts and pages on the live website while I've been developing locally? When I upload my local copy it will erase the latest posts and pages. The only solution I have come up with is manually mimicking the settings on the live server with the local settings before uploading the files.
This doesn't seem very efficient. Is there another, better way?
At the moment my current workflow looks like this.
I will take the latest copy of WordPress and its database from the live server and develop it using MAMP on my machine.
On my local server I will make my changes. For example, I might add a new custom post type and some custom fields using the Custom Post Type UI and Advanced Custom Fields Plugins. Then I would code a custom post type template. After that I will change the settings in my wp-config.php, upload the whole WordPress directory to the live server (which takes ages) and do a search and replace on the database.
What if someone has created new posts and pages on the live website while I've been developing locally? When I upload my local copy it will erase the latest posts and pages. The only solution I have come up with is manually mimicking the settings on the live server with the local settings before uploading the files.
This doesn't seem very efficient. Is there another, better way?
Share Improve this question asked Sep 8, 2014 at 14:57 chapchap 3581 gold badge4 silver badges19 bronze badges 1- I think you could find a tool which syncs your local installation with your live server. A staging site is one thing but its also hosted on a live server. – Brad Dalton Commented Sep 8, 2014 at 15:32
1 Answer
Reset to default 1Making content (database) changes on a staging environment is never recommended. You should only use a local/staging environment for template changes. Then, update your theme/plugins (the wp-content
folder), and push those files to the live site. Once that's completed, you can then populate the content.
Database merging/synchronization is it's own specialty/portion of the industry, and it's very strenuous and fickle. It's a workflow change, for sure, but you need to really consider the files and the database two separate entities in all cases. The piece you mentioning of "The client has added new content" is the exact use case that will happen every time, and there is no easy way around it except to avoid the conflict in the first place.
本文标签: migrationHow to upload local changes to a live server without overriding new postspages
版权声明:本文标题:migration - How to upload local changes to a live server without overriding new postspages? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744765484a2624013.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论