How do i set up a testing environment

Hi from totally wet and gloomy York UK,

I am rebuilding another version of my site I want to host it in a test environment and when its ready it will replace the existing site. (currently hosted via 123 reg).

My question is how can i got about setting up a testing environment for a new version of a site that will populate the same url (if that makes sense).

I am a bit worried i could create a duplicate site and / or the transfer into the live site proper from the test environment may be too complicated for me.

Any insights welcome :slight_smile:

When I’ve transferred sites from one hosting company to another, I’ve simply download the site via cPanel, and then uploaded it to the new host and asked them to install it for me. Never a problem.

However, this approach requires both hosts to be using cPanel, and last time I had anything to do with 123-reg, they used their own control panel. (One of the reasons I don’t like them and don’t use them.)

Are you developing the site on your local machine, or on the same hosting that your current site is on? If the site under development is online, make sure it’s protected by robots.txt until you’re ready for it to go live, just in case Google/Bing/others find it. That will solve your worries about a “duplicate” site, at least.

Hi TechnoBear and thank you for getting back to me :smile:

No its not live, I’m building it on my machine and test it via codepen but some Sitepoint members suggest for testing purposes its best to go into a real hosting environment. This I get but its half built and is an evolution (the next version) of an existing live site.

Not sure what I’m supposed to do now if my goal is to get the testing site in a real hosting environment.
I do understand the robot text thing you refer to however.


123 reg give me their answer:
Dear David,

Thank you for contacting 123-reg on the 15th September 2015.
Unfortunately, no there isn’t an easy way you can do this. The easiest solution for you is to purchase another hosting package where you can build your website and once that is done simply cancel one of the packages.
There is also the option of building the website in a separate folder on your hosting package, however, this would mean that the website is build around and it would be more complicated to actually move the content from the folder in question /yourfolder to the root folder public_html. Depending on the website this would involve changing the coding on the website, plugins URLs etc.

If we can be of any further help with regard to this or any other matter, please do not hesitate to contact us.

Kind Regards


This is the next thing I would have suggested. Build the site locally, and upload it periodically to a folder under your existing domain (protected by robots.txt) to test. As long as you use relative links, rather than absolute URLs, you shouldn’t have a problem. i.e. link to “images/picture.jpg”, not “”.

1 Like


Can you create and upload your site to

This sounds good but I’m an extreme boob with all things web! I have a question, "Would creating a subdomain within my live site cost me anything extra?


This sounds good but I’m an extreme boob with all things web! I have a question, "Would creating a subdomain within my live site cost me anything extra?

Ask your service provider if there is a charge.


Aw, I started with Kevin Yank’s book Build Your Own Database Driven Website Using PHP & MySQL. It appears that he’s now selling PHP & MySQL: Novice to Ninja which should be pretty much the same thing (except that he’s abandoned the separate daemon installations late in the versions of the original book which I believe is a shame as it is both a great learning experience AND allows you to use versions to match what your host provides).

That said, the first chapter of the original book was offered free. It didn’t “flow” neatly so I modified Kevin’s process and saved it in a .txt file. If you need my guide/checklist, PM me.

As for your host’s suggestion to buy another account to use as a test platform, that’s just plain absurd (and greedy). I learned more from creating and testing my websites on my computer before uploading than I had ever done by testing online - and it’s free!

Transferring a website from your computer to your online website is trivial. Simply (S)FTP to your website’s location and upload the files. Yes, if you use a database, you’ll need to establish the database on your server (and note cPanel’s prepended names on the database and user on your host) and use PHPMyAdmin to create the database offline (and user) offline then simply upload via the EXPORTed .sql file from your test server (via PHPMyAdmin on the production server).

It can’t be easier and I can report that, once I created my test server, I’ll NEVER go back to testing new code on a production machine (only after I upload - it’s good practice to make that last check).

If you’re on a WinDoze box like I am, just be sure NOT to install anything to the Program Files directories (or any other directory “protected” by WinDoze). In fact, I’ve created a partition just for my website work and it holds all my daemon and website files.

Give it a go - you’ll never look back!



1 Like

Thanks dk, yes your right ive since learnt im bot buying another hosting pack Ive decided to use my existing pacckage and test vis a subdomain then push it up to the suface if that make sense, thanks for your reply :slight_smile:


While that makes more sense than paying for another account (with a different domain name), it’s clearly not as simple as creating a test server on your own computer:

  1. You don’t have to juggle domain names and subdomains (simply drop the TLD for localhost testing).

  2. You don’t have to upload - every file you save is “live” on the test server.

  3. You are always “live” on your test server - even without an internet connection.

  4. You can configure your test server the way you want (to trial modules like mod_speling).

  5. You have no fear of posting sensitive information online and having it seen (via the website - a subdomain is usually in a subdirectory).

  6. It’s FREE and cannot impact your host’s bandwidth OR storage OR CPU limitations!

  7. Finally, you asked about setting up a test environment. Doing that ONLINE is not considered (IMHO, of course) a testing environment - that is the realm of an OFFLINE environment.

There is no excuse for putting up with dealing with subdomains (or another account) on a hosting package when you can have it all on your own computer!

WARNING: That said, there is a MAJOR difference between testing offline and hosting your website on your own computer - the security issues (and violation of your ISP’s T&C) are insurmountable.



This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.