A test site before touching what is live

Half the broken sites we see broke the same way: somebody updated, installed or changed something on the live site, mid-afternoon, and had no site for two hours. The solution is old, well known, and almost nobody uses it: have a copy to try things on first.

What a test site is

It is a copy of your site running at an address only you use — test.yourdomain.ao, say — with the same files and a copy of the database. You do everything there, confirm it works, and only then touch what is live.

It costs nothing new: it uses the space in the plan you already have, and a subdomain is created in seconds.

When it genuinely pays off

Situation Test first?
Updating WordPress or an important plugin Yes, especially on a shop. It is the number one cause of sites going down.
Changing theme or reworking the design Yes. Nobody wants customers seeing the middle of the building work.
Changing PHP version Yes if the site is old — see viewing and adjusting your PHP configuration
Fixing a typo in some text No. Do not turn this into bureaucracy — for small edits, edit directly.

The quickest route: WP Toolkit

If the site is WordPress, cPanel has WP Toolkit, which does this almost by itself: it finds your installations and offers a clone option to a new address. It handles the files, creates the database and fixes the stored addresses — the part most people forget when doing it by hand.

1 Open WP Toolkit and choose the site's installation.
2 Use the clone option and give it the destination subdomain.
3 Wait for it to finish and open the new address. You should see the site exactly as it is live.
4 Do there whatever you had to do. If it breaks, it broke the copy — not your customers' site.

By hand, if it is not WordPress

1 Create the subdomain — see adding domains and subdomains. It is ready immediately, with its own certificate.
2 Copy the files into its folder, through File Manager.
3 Create a new database and import a copy of the original — see creating databases and using phpMyAdmin.
4 Point the test site's configuration file at the new database. This is the critical step — see the warning below.
The mistake that ruins it: both copies on the same database. If the test site stays connected to the real site's database, it is no longer a test — it is the real site at another address. Anything you delete or break in testing happens on your customers' site, immediately. Always confirm, in the configuration file, that the database name is the copy's.

Two things always to do on a test site

1 Block it from search engines. If Google indexes the copy, you have two identical sites — and it may show the wrong one. WordPress has an option for this in the reading settings; on any site, a directory password does it. See being found on Google.
2 Disable anything that sends or charges. A test site wired to the real payment gateway can charge for real, and a test form can send real e-mails to your customers. On a shop this step is not optional — see an online shop with local payment methods.

Moving the changes to the real site

This is where many people go wrong, because cloning back the other way is tempting. But the real site gained content while you were working — orders, comments, new text — and writing the copy over it erases all of that.

What changed How to move it
Updates and plugins Repeat the same update on the real site. You already know it works, and it takes no time.
Theme or file changes Copy the changed files, and only those.
A brand new site Then yes, replacing the old one wholesale is worth it — but with a copy saved first: making and keeping your own backup
Delete it when you are done. A forgotten test site is an out-of-date site taking up space and serving as a way in — nobody updates it, because nobody remembers it. We have seen sites broken into through the test copy the owner left behind two years earlier. See how to tell if your site has been compromised.

And before touching either of them, the eternal rule: have a copy of your own. If the live site breaks anyway, common WordPress errors and website errors are the two fastest routes back.

Want help setting up a test site before a big change?

Talk to us

RECOMMENDED PRODUCT

Web hosting with cPanel

Domain and SSL included, daily backups and the panel you already know. from $9.99/mo

See plans
  • 0 Users Found This Useful
Was this answer helpful?