Cloning a website for testing purposes

Many times I have found I have needed to do something to a live site, but i didnt want anybody to see what i was doing, nor did i want to inconvenience any of my users. So, i want to create a clone website right on my interserver account.

Normally I might just run virtualbox.org and install a centOS distro, and test it there, but sometimes that is not practical. In this case, I needed to run on the same server using the same domain name due to licensing restrictions.

For example, we have a wordpress website that is running multiuser-WP, but we need to switch it back to single-user. there does not seem to be any decent tools that are up to the task, so i am going to attempt to take the live site, clone it, and re-install all the wordpress plugins.

steps to "clone" a website (remember, this is for testing purposes only):

for this writeup, pretend i have a website called iLoveInterServer.net

1) purchase new IP number. (lets pretend my new IP ## is 199.231.111.222)

2) issue the following shell command (substitute your IP number)
ifconfig eth0:1 199.231.111.222 netmask 255.255.255.224

3) create the new "fake" domain name in your control panel. i am creating this one for example:
interServerLovesMe.net

4) edit /etc/httpd/conf/httpd.conf - your new website should be at the bottom of the file
4a) change new fake domain name to existing (live) name [probably in eight places].
4b) change SuexecUserGroup from fake one to existing (live) one if you are running fast-cgi.

5) copy/tar your old website into the new location created from step three

6) issue the following shell command to fix the protection problem:
chown -R iLoveInterServer.net:iLoveInterServer.net /home/interServerLovesMe.net/public_html/

7) in your own local etc.hosts file, add the following two lines at the bottom:

199.231.111.222 iLoveInterServer.net
199.231.111.222 www.iLoveInterServer.net

in windows, the file is located in: C:\Windows\System32\drivers\etc

8) (recommended)- somehow alter the "fake" website so you can tell the difference easily. i like to have either the word "fake" at the top or show the IP number.

9) you may need to do a browser cache-flush in order to get this to work.


remember to switch back to your live site when done !
 

hydrlon

New Member
Many times I have found I have needed to do something to a live site, but i didnt want anybody to see what i was doing, nor did i want to inconvenience any of my users. So, i want to create a clone website right on my interserver account.

Normally I might just run virtualbox.org and install a centOS distro, and test it there, but sometimes that is not practical. In this case, I needed to run on the same server using the same domain name due to licensing restrictions.

For example, we have a wordpress website that is running multiuser-WP, but we need to switch it back to single-user. there does not seem to be any decent tools that are up to the task, so i am going to attempt to take the live site, clone it, and re-install all the wordpress plugins.

steps to "clone" a website (remember, this is for testing purposes only):

for this writeup, pretend i have a website called iLoveInterServer.net

1) purchase new IP number. (lets pretend my new IP ## is 199.231.111.222)

2) issue the following shell command (substitute your IP number)
ifconfig eth0:1 199.231.111.222 netmask 255.255.255.224

3) create the new "fake" domain name in your control panel. i am creating this one for example:
interServerLovesMe.net

4) edit /etc/httpd/conf/httpd.conf - your new website should be at the bottom of the file
4a) change new fake domain name to existing (live) name [probably in eight places].
4b) change SuexecUserGroup from fake one to existing (live) one if you are running fast-cgi.

5) copy/tar your old website into the new location created from step three

6) issue the following shell command to fix the protection problem:
chown -R iLoveInterServer.net:iLoveInterServer.net /home/interServerLovesMe.net/public_html/

7) in your own local etc.hosts file, add the following two lines at the bottom:

199.231.111.222 iLoveInterServer.net
199.231.111.222 www.iLoveInterServer.net

in windows, the file is located in: C:\Windows\System32\drivers\etc

8) (recommended)- somehow alter the "fake" website so you can tell the difference easily. i like to have either the word "fake" at the top or show the IP number.

9) you may need to do a browser cache-flush in order to get this to work.


remember to switch back to your live site when done !
Thanks for the tutorial, I really needed to do this somehow, since I was having client-side issues.
 
hydrolon -- the easiest way i have found is to go 1and1.com and purchase a dot-info name for $1. but this assumes you can get away with non-matching domain names. in my specific situation today, my domain-names needed to be a perfect match.

IMHO, vendors should be willing to give away a 30-day license if the domain-name prefix part matches, or at least have some sort of limited-usage version for clients with a paid license.
 

hydrlon

New Member
hydrolon -- the easiest way i have found is to go 1and1.com and purchase a dot-info name for $1. but this assumes you can get away with non-matching domain names. in my specific situation today, my domain-names needed to be a perfect match.

IMHO, vendors should be willing to give away a 30-day license if the domain-name prefix part matches, or at least have some sort of limited-usage version for clients with a paid license.
Will do, but I'm a cheap fellow, so would .tk domains work?
 
hydrolon - not to "out-cheap" you, but you can also just make up a fake domain name, make it "live" on your server, and then hack your local hosts file with that new fake domain name and your current IP number. thats free!

just don't forget to back out those changes in your host file, otherwise you might be in for a few surprises down the road. i try to keep a shortcut-link to the hosts file on my desktop as a reminder.
 

Quags

Administrator
Staff member
You can also ask for a sub domain on a interserver domain name like

name.trouble-free.net
 

prey

New Member
Thanks, I've wanted to try this for a while, but I was wise to try it on a recently-released forum of mine because somehow I managed to wipe out all the data. I can't even explain how, really, but it seems I'm a pretty uncommon person. :)
 

Kamarsun1

New Member
Many times I have found I have needed to do something to a live site, but i didnt want anybody to see what i was doing, nor did i want to inconvenience any of my users. So, i want to create a clone website right on my interserver account.

Normally I might just run virtualbox.org and install a centOS distro, and test it there, but sometimes that is not practical. In this case, I needed to run on the same server using the same domain name due to licensing restrictions.

For example, we have a wordpress website that is running multiuser-WP, but we need to switch it back to single-user. there does not seem to be any decent tools that are up to the task, so i am going to attempt to take the live site, clone it, and re-install all the wordpress plugins.

steps to "clone" a website (remember, this is for testing purposes only):

for this writeup, pretend i have a website called iLoveInterServer.net

1) purchase new IP number. (lets pretend my new IP ## is 199.231.111.222)

2) issue the following shell command (substitute your IP number)
ifconfig eth0:1 199.231.111.222 netmask 255.255.255.224

3) create the new "fake" domain name in your control panel. i am creating this one for example:
interServerLovesMe.net

4) edit /etc/httpd/conf/httpd.conf - your new website should be at the bottom of the file
4a) change new fake domain name to existing (live) name [probably in eight places].
4b) change SuexecUserGroup from fake one to existing (live) one if you are running fast-cgi.

5) copy/tar your old website into the new location created from step three

6) issue the following shell command to fix the protection problem:
chown -R iLoveInterServer.net:iLoveInterServer.net /home/interServerLovesMe.net/public_html/

7) in your own local etc.hosts file, add the following two lines at the bottom:

199.231.111.222 iLoveInterServer.net
199.231.111.222 www.iLoveInterServer.net

in windows, the file is located in: C:\Windows\System32\drivers\etc

8) (recommended)- somehow alter the "fake" website so you can tell the difference easily. i like to have either the word "fake" at the top or show the IP number.

9) you may need to do a browser cache-flush in order to get this to work.


remember to switch back to your live site when done !
Thanks for the information, I am very new at this subject and I'm soaking up the knowledge, but I get the general ideal of cloning a site. I will have to apply this technic but I don't think this is a beginners task.
 

cthoughtz

New Member
I would just clone the site and use a local host, use something like xampp, then you can test it to see what is working and what is not.
 

djinter

Member
Great. I was looking for something like this a few days ago. I need to do the same thing but do not want to inconvenience my users either. Thanks.
 

SirJoe

New Member
Normally I might just run virtualbox.org and install a centOS distro, and test it there, but sometimes that is not practical. In this case, I needed to run on the same server using the same domain name due to licensing restrictions.
The first thing that I thought of when i read the tittle was exactly this. lol
Good tutorial, it's a good alternative.
 
I have never done this, I mean cloning a website. However at a time I have felt a necessity to have a clone so that I can test something before I lunch. Thanks for this tutorial.This will help me.
 

H.Charles Beil

New Member
A 'sandbox' site can be created on your webhost by simply creating a new folder and copying your files to it. You can work on your site within this folder.

OR....

Download HTTrack and clone your site to your PC, work on it there with your choice of editor and upload your changes to your site. HTTrack is a nice tool that clones sites. If you've ever seen a cool feature on a site and wanted to see how it was coded so that you could build something similar it works great for this. Everything is done offline and is editable.

I highly caution (DON'T) work on your site live. Too many things can go wrong that will bring it down. Do everything from a 'sandbox' and when you've got it right, upload the new files ..... Always backup your site before uploading your new files!

3rd WAY......
I'm in the process of building a new computer where I will emulate the Interserver VPS that I'll be using....ie...same OS etc. so that I can sandbox my site in the same environment from which it will be running.
 
Top