How to clone and locally run a network for testing

You’ll have to set up a domain with wildcard subdomains in your localhost (I usually set up thelivedomain.local), direct that to 127.0.0.1 in your hosts file and run the DB search and replace tool against your local copy of the site to safely replace the live domain with your localhost domain in the WP database, because it stores URLs in serialized arrays which can break with a search&replace against the raw SQL.

You’d also have to make sure that your localhost’s PHP version is the same and that you have the same PHP extensions enabled in your local environment as on the live server.

Leave a Comment

tech