The MU forums have moved to WordPress.org

Duplicating Live Site for Testing (8 posts)

  1. northernwolf
    Member
    Posted 14 years ago #

    Hello all,

    I've inherited a WPMU site from a colleague who is no longer with the company and I'd like to set up a test site. I've set up a Virtual Machine locally, installed the same version of Linux, Apache and MySQL the live site has and I've copied over the files and DB from the live site. My issue of course is that the local site immediately redirects me to the live site when I try to access it. I've gone into the wp_config file as well as the wp_blogs and wp_sites tables on the DB and changed the URL of the live site to "localhost" but I'm still getting a redirect to the live site. What am I missing? Any ideas?

    Thanks in advance!

  2. andrea_r
    Moderator
    Posted 14 years ago #

    Al the domain references in the database will have to be replaced.

  3. northernwolf
    Member
    Posted 14 years ago #

    Thanks for the quick response andrea_r! I guess I'm asking if you know where the other references are...

  4. mark-k
    Member
    Posted 14 years ago #

    northernwolf, no need to do anything fancy - just use your hosts file to map the real domain to the IP of the test server.

  5. andrea_r
    Moderator
    Posted 14 years ago #

    Yeah, you could do that too. But every time you wanted to visit the real domain, you'd have to change your hosts file again.

  6. northernwolf
    Member
    Posted 14 years ago #

    Mark, thanks for the idea. I'm not inclined to change my hosts file for reasons irrelevant to this discussion plus what andrea_r mentioned. Besides, the hosts file won't keep the site from redirecting to the live server even if the hosts file tells the browser to go to the ip of the server.

    I've searched through the DB and changed every instance of the URL of the live server, but it still redirects. Any other ideas?

  7. northernwolf
    Member
    Posted 14 years ago #

    Bump. Help?

  8. northernwolf
    Member
    Posted 14 years ago #

    Ok, after much research I've actually stumbled upon the answer elsewhere. Of course it turns out to be simple;
    1. Backup the original database to an .sql file.
    2. Open the .sql file with notepad or similar.
    3. Search and replace all instances of the old URL and replace with the test site URL.
    4. Build new DB using the amended .sql file.

    Hope this helps someone else!

About this Topic

  • Started 14 years ago by northernwolf
  • Latest reply from northernwolf