Cloning and synchronizing WordPress sites between environements (dev, staging, production) is something I would love to be able too. Wordmove sure is a great tool, but unfortunately it’s nearly impossible to get it working on Windows. And believe me, I have spent hours trying.
A client recently got in touch with me, asking for some changes on his existing website. Therefore I wanted to have a local working copy of the live production site. As I’m unable to use Wordmove because I’m still stuck with Windows 10, I had to figure out a reliable solution for cloning a live WordPress site into my local dev environment.
10 Steps to clone a live WordPress site locally
- Create an archive of
wp-content. You can do that easily using your host File Manager, or via SSH.
- Export your WordPress site database (either using phpMyAdmin or mysqldump directly)
- Install WordPress locally.
- Empty your local database & Import your live database (
- Remove you local
wp-contentfolder, and replace it with the one you just downloaded.
- Check that the database connection is still work. If not, open your local
wp-config.phpand make sure that the
$table_prefixvariable matches with the database prefix you just uploaded.
- Download this tool, and unzip into a folder
/sr/that is located at the same level as /wp-admin /wp-content /wp-includes
- Open that newly created URL in your browser: http://example.dev/sr/
- In the field
replace, type your local site URL (in this example http://example.dev) without trailing slash. In the field
with, type your live site URL (in this example http://example.com) without trailing slash.
- Hit “Live Run”, remove the
/sr/folder and reload your local WordPress site. Enjoy.
Please leave some feedback in the comments.