Skip to content

Moving a site to a new domain while switching hosts

Updated 6 min readBy the DNSPeek team

When you change domain and host at once, build the site on the new server under the new domain, map every old URL to its new URL, and test both before you touch DNS. Then point the new domain at the new server and turn the old domain into page-to-page 301 redirects. Keep the old domain registered and redirecting for at least a year, and tell search engines about the move.

Two moves at once

A rebrand on a new server is really two migrations: a server move, which is about DNS and infrastructure, and a domain move, which is about URLs, redirects and search engines. Doing them together saves a second cutover, but when something breaks it is harder to tell which change caused it.

If you can, move hosts first with the old domain, let it settle for a week or two, then change the domain. If you must do both together, the steps below keep the risk manageable by testing everything before any DNS change.

Build the redirect map first

List every URL on the old site that matters: pages from the sitemap, pages with search traffic or backlinks, files people link to such as PDFs. Map each to its new address. Where paths stay the same, one domain-wide rule covers everything; where they change, you need specific rules.

Example redirect map
Old URLNew URLRule
https://old-brand.com/https://new-brand.com/Domain-wide, same path
https://old-brand.com/services/web-designhttps://new-brand.com/services/web-designDomain-wide, same path
https://old-brand.com/about-ushttps://new-brand.com/companySpecific rule (path changed)
https://old-brand.com/old-promohttps://new-brand.com/offersSpecific rule (closest equivalent)

Use permanent redirects (301 or 308) from each old URL straight to its final new URL, in one hop. Avoid sending everything to the new home page: search engines treat that like a missing page, and visitors lose their place.

nginx: old domain → new domain, same paths
server {
    listen 443 ssl;
    server_name old-brand.com www.old-brand.com;
    # ssl_certificate ... (the old domain still needs a valid certificate)

    location = /about-us { return 301 https://new-brand.com/company; }
    location / { return 301 https://new-brand.com$request_uri; }
}

Step by step

  1. Step 1: Map old URLs to new URLs

    Export the old site’s URLs from its sitemap and analytics, and write the redirect map: same-path rule plus specific rules for changed paths.

  2. Step 2: Build the site on the new server under the new domain

    Install and configure the site with the new domain as its address. Replace the old domain in the database and templates.

  3. Step 3: Preview the new domain on the new server

    Create a preview link with the new domain and the new server IP. The new domain does not need to point anywhere yet: DNSPeek connects to the IP you enter.

  4. Step 4: Compare against the old site

    Set the link’s old site address to the old domain and use Live compare to go through key pages side by side. Run a QA report for broken pages and leftover links to the old domain.

  5. Step 5: Prepare redirects and certificates for the old domain

    Configure the old domain’s redirects on the new server or at your CDN, with a valid certificate for the old domain too.

  6. Step 6: Switch DNS for both domains

    Point the new domain at the new server, then point the old domain at whatever serves its redirects. Lower both TTLs a day ahead.

  7. Step 7: Test the redirects and notify search engines

    Check a sample of old URLs with the redirect checker, then submit the change of address and the new sitemap.

  8. Step 8: Keep the old domain redirecting

    Keep the old domain registered and the redirects running for at least a year, longer if it has valuable backlinks.

Compare the new domain with the old site

Side-by-side comparison is the best way to catch what got lost in a rebuild: a missing section, an old logo, a broken layout. Usually DNSPeek compares the preview with the live site on the same domain. When the domain changes, the old server only answers on the old domain, so the “current server” side would show nothing useful.

For this case a DNSPeek link has an old site address. Create the preview link for the new domain and the new server IP, then fill in Old site for comparison in the link settings: the old domain, and optionally the old server’s IP if the old domain no longer points there. Live compare then opens the old site on the left and the new one on the right, scrolls both together and follows navigation by path. On paid plans, screenshot compares and client share links use the old address too. Details: The domain changed during the migration.

Paths are synced, not domains

Following a link to /pricing on one side opens /pricing on the other. Where the new site uses different paths, open the page on each side yourself. Absolute links to the other domain inside the pages are left as they are.

Things that are easy to miss

  • Sign-in and payment callbacks: OAuth apps, payment providers and SSO register return URLs per domain. Add the new domain before the switch.
  • Email: addresses on the old domain should keep receiving mail, or forward, for a long time. Do not drop the old domain’s MX records.
  • Logins: cookies belong to a domain, so every visitor is signed out once. Warn members or customers.
  • Analytics and ads: update the property URL, conversion settings and ad destination URLs.
  • Certificates for both domains: the old domain needs a valid certificate to redirect HTTPS requests without a browser warning.
  • Renewal: keep the old domain registered. If it lapses, someone else can buy it and inherit your links.

Check the redirect chain of the old domain with the redirect checker and the new certificate with the SSL checker right after the switch.

Domain and host change checklist

New domain, new host

  • Old URL inventory exported (sitemap, analytics, backlinks)
  • Redirect map: every important URL has a one-hop 301 target
  • Site built under the new domain on the new server
  • New domain previewed on the new server IP
  • Old site address set; key pages compared side by side
  • QA report: no links to the old domain or staging hosts left
  • OAuth, payment and SSO callbacks updated for the new domain
  • Certificates valid for both domains
  • TTLs lowered for both domains
  • DNS switched; redirects tested on sample URLs
  • Search Console change of address and new sitemap submitted
  • Old domain email still received or forwarded
  • Old domain renewal secured for the long term

Frequently asked questions

Should I change my domain and host at the same time?

It works, but it is safer to separate them: move hosts first on the old domain, then change the domain once the new server is stable. When both happen at once, test thoroughly before any DNS change.

How long should I keep 301 redirects from the old domain?

At least a year, and ideally for as long as the old domain has backlinks or people use it. Keep the domain registered so nobody else can take it.

Will I lose SEO rankings when changing domains?

Some short-term fluctuation is normal. Page-to-page permanent redirects, a change of address in Search Console, updated canonicals and internal links let search engines transfer most signals to the new domain.

Can I preview a new domain before it points to any server?

Yes. A DNSPeek preview link connects to the server IP you enter and sends the domain name you give it, so the new domain does not need DNS records yet. The server must be configured to answer for that domain.

How do I compare the old and new site when the domain changed?

Give the DNSPeek preview link an old site address: the old domain, plus the old server IP if needed. Live compare then shows the old site next to the new one and syncs scrolling and navigation by path.

Moving a site? Use the migration checklist

Every step from lowering the TTL to checking email after the switch, on one printable page. With a free account you keep your preview links in one place and run a QA report of the site on the new server.

Check the new server before you switch

DNSPeek gives you one HTTPS link that shows your site from the new server while DNS still points at the old one. Open it on any device, share it with your team or client, and run a QA crawl on the same link.

Create a free preview link