Test a site, then make it live
A test environment is a protected copy. Restore or import a site into it, check pages and the email it sends without reaching a real customer, then make it live when it is ready. Your original site keeps serving the whole time.
What a test environment protects
- Mail is captured. Everything the site sends through WordPress's own mail function lands in the Mail tool, and nothing reaches its recipient. Nothing can be forwarded or released.
- Outside services are blocked. Payment providers, outside mail servers, webhooks, CRMs, SMS gateways and every other public address are unreachable, so a copied plugin cannot charge a card or send a message. A plugin that sends mail through its provider's web API is blocked, not captured.
- Scheduled tasks are off. WordPress scheduled tasks (WP-Cron) do not run. To test one, run it
in the Terminal:
wp cron event run <hook>. - Pages are not indexed. Every response asks search engines not to index it.
Two things it does not do:
- Other sites served by this platform may still be reachable over HTTPS, because the tools' sign-in needs it. Do not point a test plugin at a live site hosted here.
- No-index is not access control. Anyone with the preview address can open the site until you turn on site sign-in for the environment.
Captured mail is cleared when the environment restarts or is deleted.
Create one and restore into it
- Open Hosting → Environments, choose New environment and set Kind to Test environment. See Create an environment for the other fields.
- Wait for the Overview to say Protected under Test environment. Until then a restore or an import is refused, so nothing restored can send mail or reach an outside service first.
- Restore a backup or move your files into it.
- Use the site at its preview address. Choose Open captured mail to read what it sent.
From the terminal: hostingctl environment create --company <slug> --name <name> --environment-mode test --confirm.
Make it live
Going live is a configuration change, not a fresh restore: the environment keeps its data, and real mail, outside services and scheduled tasks are switched on. The environment stays in its current hosting location.
- On the Overview, under Test environment, choose Make live.
- Read what changes and the warnings. Two matter most:
- Scheduled tasks that came due while you tested run on the first page view. Review them in the
Terminal first (
wp cron event list) and delete any that must not run. - If the original site is still running elsewhere, stop its scheduled tasks and outgoing mail first, or both sites will run them.
- Scheduled tasks that came due while you tested run on the first page view. Review them in the
Terminal first (
- Say how the copy relates to the original site: either it holds everything that should go live, or you restored the original into it again, after it stopped taking changes, just before going live.
- Choose Make live. If the environment changed since you opened the review, you are asked to review again.
Going live does not move a domain or turn site sign-in off. Afterwards, add your domain to the application; its certificate is issued before traffic moves. Turn off site sign-in when the site should be public.
From the terminal:
hostingctl environment mode review <environment-uuid> --company <slug> --to live
hostingctl environment mode set <environment-uuid> --company <slug> --to live \
--data-handover test_copy_is_current --confirm
--to test returns a live environment to test protection. That contains what happens from then on;
it cannot recall mail already delivered or undo what outside services already received.