0

I have a live network installed on a remote web server. I am about to start writing some plugins for it but want to test that they behave before disrupting a live site.

I was thinking that I would clone the site (backup the database, download via FTP the files) and restore to localhost for testing. The remote site uses subdomains for blogs.

What steps do I need to take so that my clone behaves pretty much as the remote version?

What changes do I need to make so that it can run as localhost instead of as a remote URL?

1 Answer 1

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.