easily migrate wordpress database from local to pr

2019-05-21 12:26发布

I find myself constantly doing this routine to migrate a wordpress database to staging or production servers:

  1. doing a SQL dump of the local wordpress database
  2. open the .SQL file then search and replace all "localhost:9999" with "mysite.com"
  3. import modified .SQL to production database

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?

Thanks!

1条回答
叛逆
2楼-- · 2019-05-21 12:49

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.

Article:
http://codex.wordpress.org/Moving_WordPress

Search and Replace Tool:
http://interconnectit.com/products/search-and-replace-for-wordpress-databases/

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.

查看更多
登录 后发表回答