最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

localhost - Cloning production site down to local?

programmeradmin0浏览0评论

I've been using WordPress for awhile now but one problem I'm constantly facing is creating a local clone of a production site so I can test changes/updates.

My current process goes something like this...

  • Run XAMPP Server
  • Download the site files (Filzilla)
  • Download the database (phpMyAdmin)
  • Create a local database (phpMyAdmin)
  • Copy site files into XAMPP
  • Import database
  • Update WP hostname, settings, etc

My question is simple. Is it possible to automate this entire process? If not, what can be automated to make this less time consuming?

I've kinda looked into Docker but it seems confusing and I don't know that it helps with most of these steps. I know there are plugins that can create backups of the site but again that only automates a couple steps. I'm pretty sure WP CLI can clone a site but I'm not sure if it can clone a remote site down to local. A solution using WP CLI would be great.

There has to be a better process than I'm doing now :(

I've been using WordPress for awhile now but one problem I'm constantly facing is creating a local clone of a production site so I can test changes/updates.

My current process goes something like this...

  • Run XAMPP Server
  • Download the site files (Filzilla)
  • Download the database (phpMyAdmin)
  • Create a local database (phpMyAdmin)
  • Copy site files into XAMPP
  • Import database
  • Update WP hostname, settings, etc

My question is simple. Is it possible to automate this entire process? If not, what can be automated to make this less time consuming?

I've kinda looked into Docker but it seems confusing and I don't know that it helps with most of these steps. I know there are plugins that can create backups of the site but again that only automates a couple steps. I'm pretty sure WP CLI can clone a site but I'm not sure if it can clone a remote site down to local. A solution using WP CLI would be great.

There has to be a better process than I'm doing now :(

Share Improve this question edited Aug 17, 2020 at 14:16 Jon asked Aug 14, 2020 at 19:34 JonJon 3275 silver badges17 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 0

It can absolutely be done using WP-Cli.

Do you have SSH access to the remote server/site? If so, I am happy to show you a process I’ve cooked up using rsync as well as just some standard SQL for the database. That’s my preferred way to do it at the moment.

Yes, there are a number of ways to automate the process of moving sites between local, dev and production.

The first is a plugin by Delicious Brains called WP Migrated DB Pro. The basic free plugin will move DBs between WP installs. But the add-ons really supercharge it and allow you to move images, themes and plugins, and there's a multi-site add on as well. It's one of my most cherished tools, and it makes things SO much easier.

The second tool is Local by Flywheel. This is another method for all-in-one WP push/pull. This tool was purchased by Flywheel who were then purchased again, so it's getting a lot of attention and has recently been significantly upgraded. I haven't used the upgraded version, but the version I have used made it VERY simple to move sites between hosts.

Good luck!

发布评论

评论列表(0)

  1. 暂无评论