Netlify to Cloudflare
A hassle-free migration experience.
Weekends in my hometown sometimes teach me a lot more than weekdays. Imagine being more productive by updating all the instances and then it breaks, which was actively used by our clients. That ruined my weekend for at least a couple of hours.
As much as I love the adrenaline rush to get it back in working order, I wish I could push a button and revert myself back just a few minutes. But I wouldn’t learn as much by doing that. It’s not all bad stories, though. Some weekends are a lot better when things work as expected or beyond expectations.
For example, when I decided to switch over from Netlify to Cloudflare Pages for this site. Netlify is great, even better than Heroku I used 10 years ago. But thanks to Heroku, I learned so much about cloud and working with Git. These days, almost every cloud platform has some way of integrating Git workflow into their platform. Take Netlify, for example. By itself, you can deploy your app/site without having to use any repository control, but it works better when you use them. Just point it to your repo, and you’re done. And you don’t even need to input the build command anymore.
If you don’t use Git to manage your code, then I’m questioning your sanity. A few extra commands in your workflow will save you tons in the future. Don’t be scared of the Terminal/Powershell, use them to your advantage. They’re your friend. GUI will rob you of being awesome.
Enough with the rant, back to the topic. I’ve been a Cloudflare user since my early days with Heroku. Unfortunately, due to Heroku’s nature of spinning down the dyno when it’s not in use, pairing it with Cloudflare as a Content Delivery Network (CDN) didn’t work so great. I’ve been getting “Host Not Reachable” for most of the time, so I ended up not using it as much.
Time flies, things change, and Cloudflare becomes a Domain Registrar. I moved this domain to give it a try, and I loved it. Soon, I moved all the domains into Cloudflare. Before this, I was using a third-party nameserver to manage domains. Now, everything is under one place. I can buy, renew, and manage domains with just a single sign-in. I can accelerate my web with just a flick of a switch or clear the global cache in case the latest repo build didn’t show up as intended. Couldn’t ask for a better workflow.
In my previous post about Firebase to Netlify, I wrote about using Github Pages to host my site. But since it required my repo to be made public, I knew it wasn’t right for me. Since my work involves other parties, I don’t want this to be an issue, and I pretty much would like to use Github for what it is. I was also aware of Cloudflare Pages when it opened to the public in late 2021. What I didn’t expect was how stupid easy it is to migrate.
We’ve come a long way from where we began.
This is all I did to migrate: 1) authorized Pages with my Github, 2) selected repo, and 3) done. Heck, even DNS config was taken care of. That’s all. My only concern with my site was URL handling since I used a URL beautifier (instead of a href /pages/ for clean URL, I got rid of the extension) which required some kind of tuning to make it work. With Pages, it just works.
Gone are the days where you need to point out the A record.
If Moore’s Law is about doubling the transistors every two years, mine is cutting the time it required to migrate in half every time it happens. I don’t think it will be much simpler than this, but if my theory is correct, it could still happen.