First of all, we need to travel back to 2019, when Google launched a new top-level domain.
π¨π»βπ» .dev
Before making it publicly available Google decided to have an auction period, in which people could bid on a name. Which makes perfect sense for brands.
My idea was to get ricard.dev but was not willing to auction. Wasn't worth it and it seemed none wanted it anyway. Mind you, auctioning the name meant paying more upfront. Not the current, super competitive, 12β¬ a year.
On the day of the launch, I wasn't ready. I was traveling to my company's annual event and I was on my phone. I did have a reminder set, though.
When the time came I when to the Google Domains site and tried purchasing. I could add it to the cart and as I was checking out it failed. There was a problem checking out, so I sent an email to Google.
The reply?
Someone had taken my domain, just before I could check out π‘ The worst, most infuriating thing is they didn't actually use the domain. The domain had a broken 404 page with no content.
β© Fast forward 1 year
At this point there's nothing to do, the registration is yearly so I resign myself and put on a reminder for next year. This year. 2020.
The date comes and I re-check the whois. They did not renew it. Could this be my chance?
Once a domain expires it does not go back on the market instantly. They have a period on which the current owner can claim it before it turns free for all. So I set yet another reminder, hoping the owner would not renew it.
β€οΈ Saved as favorite
During all this time I had favorited the domain on my Google Domains account. It showed as unavailable but highlighted always at the top (Thank you Google for this handy feature!)
So yesterday I went into Google Domains, not to check this but for something else and I saw the "add to cart" button enabled. Not grayed out. Not disabled.
I quickly tried to check out and it worked. Yay! π
π‘ How to migrate my WordPress site to another domain?
Here's my to do list which I could complete in about an hour with 0 site downtime:
- Setup Google Domain to point to my Linode VPS.
- Create the domain in the VPS.
- Add NGINX record.
- Test a Hello World
index.html
file. - Issue a Letβs encrypt SSL certificate.
- Copy all the site files to the new location.
- Change the site URL in the WordPress using the
wp-config.php
method.
define('WP_HOME','https://ricard.dev');
define('WP_SITEURL','https://ricard.dev');
Code language: PHP (php)
- Add a 301 redirect from the old domain to the new domain with NGINX.
server {
server_name php.quicoto.com;
return 301 https://ricard.dev$request_uri;
}
Code language: Nginx (nginx)
- Test the 301 redirects from Google search.
- Delete the files in the old folder to free space.
- In Google's Webmaster tools, change the domain to the new property.
- Change social media profiles and other sites to point to the new domain.
- Update the URL in my Matomo Analytics instance.
- Change the feed URL in both Mailchimp and IFTTT, which handle sending the new posts to my email subscribers and to Mastodon.
- Find and replace the old in the database, to fix all links within the blog. Using MySQL queries:
UPDATE wp_options SET option_value = replace(option_value, 'https://php.quicoto.com', 'https://ricard.dev') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'https://php.quicoto.com','https://ricard.dev');
UPDATE wp_posts SET post_content = replace(post_content, 'https://php.quicoto.com', 'https://ricard.dev');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'https://php.quicoto.com','https://ricard.dev');
Code language: SQL (Structured Query Language) (sql)
β Live!
That's it. I think I haven't missed anything. The site seems to work just fine and it already has visits, no visible issues.
I am very happy with the new name. I created the old sub-domain more than ten years ago when I started coding and didn't know much. Now, after all these years, I can separate my developer notepad from my photography blog. Plus it looks really cool and it matches perfectly with my ricard.blog
Have you considered getting yourself a .dev
domain?