I’ve been running this blog on peterbabic.dev for a few years. Recently I migrated it to peterbabic.com. This post is a bit late because I wanted to make sure everything was working correctly before writing about it.

How I got the domains #

The .dev domain wasn’t my first choice. I bought it after it expired from someone in the Balkans - Babič is a common surname there too, not just in Slovakia. At that time, peterbabic.com was owned by someone else, coincidentally also from Slovakia, who never responded to my buyout offers.

Then in January 2023, I received an offer through DAN.com for the .com domain. I had no idea if it was legit. Searches returned mixed results about DAN.com’s reputation. The domain was parked at NameSilo, and their interface looked really scammy - even showing an “under construction” page.

But the price was cheap and it was worth the risk for me. In the end it worked out fine. I got the domain transferred without issues.

So I had both domains, but kept using .dev because migration felt risky and I didn’t want to break existing links.

Why migrate now? #

The .dev TLD was trendy when I registered it, but .com is simply more recognizable. People remember .com domains. When I tell someone my website verbally, I don’t have to explain that .dev is a valid TLD.

After owning both for a while, it felt wasteful to keep the better domain unused.

The migration steps #

The actual migration was straightforward:

  1. Update all internal references from .dev to .com
  2. Set up 301 redirects from the old domain
  3. Stop the old deployment from consuming resources
  4. Inform Google Search Console

Updating references #

This was mostly find-and-replace across the codebase. Config files, content with self-references, email addresses in legal pages. Git shows about 60 files changed, most of them just swapping the domain.

Setting up redirects #

Cloudflare makes this easy with redirect rules. I created a rule that matches all traffic to peterbabic.dev/* and redirects to peterbabic.com/$1 with a 301 status code. The $1 preserves the path, so /blog/some-post/ on the old domain goes to the same path on the new one.

301 is important here. It tells search engines this is a permanent move, not temporary. They should transfer the SEO value to the new domain.

Stopping the old deployment #

The old Cloudflare Pages project was still set up and would rebuild on every push to the repository. That’s wasteful since the site just redirects anyway.

I disconnected the git integration and deployed a simple index.html with just a meta refresh redirect as a fallback. Now it doesn’t consume build minutes.

Google Search Console #

This is the part I was most uncertain about. Google has a “Change of Address” tool in Search Console specifically for domain migrations. You verify ownership of both domains, then tell Google you’re moving from one to the other.

After submitting, GSC shows a message that it acknowledged the change and will process it over time. The old domain’s indexed pages should gradually transfer to the new one. This can take weeks or months depending on how often Googlebot crawls your site.

The confusing statistics #

The data is a bit all over the place.

Google Search Console shows .dev impressions declining and .com increasing, which is expected. But actual Google searches still show .dev URLs most of the time. The transition is happening, just slowly.

Cloudflare statistics are even weirder. The .com domain shows a massive increase in traffic since the migration, which makes sense. But .dev is showing roughly the same numbers as before - not declining at all. I would expect it to go down since everything redirects.

Maybe Cloudflare counts the redirect requests as traffic? Or there’s caching involved? Not sure. As long as the redirects work and people end up on the right domain, I’m not too worried about understanding the metrics perfectly.

Lessons learned #

The migration itself was simple. What took longer was convincing myself it was done correctly. Domain changes feel risky because if something breaks, you lose traffic you spent years building.

Having the 301 redirects in place before announcing anything was key. Old links from other sites, bookmarks, search results - they all still work. Users get transparently redirected to the new domain.

If you’re considering a similar migration, just do it. Set up redirects, update Search Console, and wait. The uncertainty goes away after a couple of weeks when you see things are moving in the right direction.

Enjoy!