Playbook

Migrating hundreds of domains to Cloudflare without downtime

Large migrations rarely fail on the technology. They fail on the record nobody knew about, the origin firewall that still blocks the new edge, or a rollback that takes two days because it depends on nameserver caches. This is the staged approach I use to keep each of those boring.

1. Inventory before anything moves

Every domain gets exported and classified before it is scheduled. For a portfolio of hundreds of zones this is scripted against the current provider's API, not done by hand.

2. Build the baseline once, apply it everywhere

Each zone lands on a known configuration instead of being tuned individually. The baseline lives in Terraform, and existing Cloudflare configuration is imported with cf-terraforming so nothing is changed by surprise.

3. Move DNS first, proxy second

This is the part that makes zero-downtime realistic. The nameserver change and the traffic change are two separate events:

  1. Lower TTLs at the old provider 24 to 48 hours ahead.
  2. Import the zone into Cloudflare with every record DNS-only. Resolution is identical to before, just answered by different nameservers.
  3. Change nameservers at the registrar and wait for the zone to go active.
  4. Confirm edge certificates are issued for every hostname that will be proxied. Universal SSL covers the apex and one level of subdomain; deeper names need Advanced Certificates.
  5. Open origin firewalls to Cloudflare's published IP ranges.
  6. Only then switch records to proxied, in waves.

Why it matters: once the zone is on Cloudflare, rolling a hostname back is a single toggle from proxied to DNS-only. Rolling back a nameserver change depends on registry and resolver caches and can take days.

4. Waves, not a big bang

Domains are grouped by risk and traffic, and each wave has a written go/no-go and rollback step.

WaveScopeGate to proceed
0 - PilotInternal and parked domainsBaseline applies cleanly, no 52x errors
1 - Low riskMarketing and static sitesCache hit ratio and error rates stable for 48 h
2 - BusinessCustomer-facing appsOwner sign-off, security events reviewed
3 - CriticalLogin, payment, APIsChange window, owners on the call, rollback rehearsed

5. Security in observe mode first

New WAF and bot rules start by observing. Where the plan supports a log action, rules run in log mode; otherwise they go live on a low-risk subset first. I review real events for a few days, write exceptions for legitimate traffic (payment callbacks, partner integrations, monitoring), and only then switch to block or challenge. Bot rules start on sensitive paths such as login and checkout rather than site-wide.

6. Watch the right signals

After each wave, a scheduled script pulls Cloudflare's GraphQL Analytics API and renders a short report per zone:

The same data feeds alerts, so a regression in wave 3 is noticed by the team before it is noticed by customers.

What makes it work

Nothing here is exotic. The difference is discipline: an inventory nobody skips, one baseline in code, DNS and proxy moved separately, and a rollback that is fast enough to actually use.

Planning a migration like this?

I help teams plan and run Cloudflare migrations through Saber Security.

Get in touch