Part 1 — I switched my website from a Raspberry Pi to a VPS and back

Introduction

This post was inspired by an outage of an e-learning platform, which you can read about here: Is it broken on my side, or theirs? A short story of one outage.

This is not about judging someone else’s outage. I treated it more as a reminder that backups and emergency procedures are only worth something once they have actually been tested.

My website, logos.net.pl, runs on a Raspberry Pi 4. I decided to check whether, in case of a problem, I could switch it to a VPS and then switch it back again.

Starting point

  • production: Raspberry Pi 4
  • backup: VPS
  • frontend: Hugo
  • backend: Flask
  • reverse proxy: Traefik
  • internet entry point: Cloudflare Tunnel
  • extra problem: a local Pi-hole pretending to be a DNS issue

Goal of the test

I wanted to check:

  • whether logos.net.pl could be quickly switched from the RPi4 to the VPS,
  • whether the website worked after the switch,
  • whether the contact form worked,
  • whether I could switch back from the VPS to the RPi4,
  • whether this mechanism would be enough to restart the Raspberry Pi after an update.

What went wrong

The biggest problem was not Cloudflare, the VPS, or Traefik.

The biggest problem was my local Pi-hole, which had cached an old DNS response and, for a while, made it look as if the failover was not working.

Failover test

curl -I https://logos.net.pl/pl/
curl -s https://logos.net.pl/health

After switching the route in Cloudflare, the website started responding from the VPS.

Contact form test

The contact form also worked after switching to the VPS. This was important, because a static website alone is not enough — the backend has to work as well.

Rollback

After the test, I switched logos.net.pl back to the RPi4 tunnel.

The rollback also worked almost immediately.

Conclusions

  • Cloudflare Tunnel is suitable for simple manual failover of a small website.
  • Public DNS can work correctly even when the local resolver is still showing old data.
  • Pi-hole can pretend to be an outage.
  • It is worth testing not only the website, but also the backend and the contact form.
  • An emergency procedure only has value once it has been practiced.

For similar infrastructure cleanup, server backup and monitoring and a technical review of service basics are useful starting points.

Checklist for the future

dig A logos.net.pl @1.1.1.1
dig CNAME logos.net.pl @1.1.1.1
curl -I https://logos.net.pl/pl/
curl -s https://logos.net.pl/health