轻松将Wordpress数据库从本地迁移到生产 [英] easily migrate wordpress database from local to production
问题描述
我发现自己一直在执行此例程,以将wordpress数据库迁移到登台服务器或生产服务器:
I find myself constantly doing this routine to migrate a wordpress database to staging or production servers:
- 对本地wordpress数据库进行SQL转储
- 打开.SQL文件,然后搜索并将所有"localhost:9999"替换为"mysite.com"
- 将修改后的.SQL导入生产数据库
我觉得这很麻烦.有没有更简单的方法可以做到这一点?我希望能像在版本控制下推送更改的文件一样简单吗?
I find this very cumbersome. Is there a more simple way to do this? I'm hoping there's something equally simple as pushing changed files under version control?
谢谢!
推荐答案
在WordPress.org上有一篇很棒的文章介绍了如何移动WP项目.具体来说,有一个非常方便的搜索和替换工具(在本文中讨论过),可以更轻松地完成您要执行的操作.
There's a great article on WordPress.org about moving a WP project. Specifically, there is a very handy search and replace tool (discussed in the article) that will more easily do what you're after.
文章:
http://codex.wordpress.org/Moving_WordPress
搜索和替换工具:
http://interconnectit.com/products/search-and-replace- for-wordpress-databases/
我建立了许多WP网站,并且这种方法每次都对我无缝地起作用.搜索和替换工具对我来说是一个实用工具.
I build a lot of WP sites and this method has worked seamlessly for me every time. The search and replace tool is a go-to utility for me.
这篇关于轻松将Wordpress数据库从本地迁移到生产的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!