
We migrated Groundswell to a new server and a new database – in 67 seconds.
Server bought on a Wednesday night. Every customer served from it by Thursday afternoon.
I have done more than 85+ complex migrations in 25 years of career. Almost all of them had the same shape: a war room, a rollback plan nobody had actually tried, a lot of coffee and a long night. Something always surprised us.
This week I moved Groundswell, our own product, to a new server and a new database engine at the same time. From buying the server to serving every customer from it took about 18 hours. The only downtime was 67 seconds in the middle of a Thursday afternoon. Nobody had to stay up.
It went like butter, and I want to explain why, because none of it was luck. You can do this too.
Why we moved
Groundswell writes, publishes and measures content & videos for small businesses. Until this week it ran on one small cloud machine with 2 GB of memory, shared with two other services, and stored everything in SQLite.
SQLite is a wonderful database. It is one file, it needs no setup, and it carried us further than most people would expect. But it lets only one writer in at a time. As we grew significantly, our background jobs (writers, publishers, schedulers) all queued for that one lock, and “database is locked” became a message we saw far too often. This was not a bug we could patch. We had outgrown the startup design.
What we moved
Two migrations at once: new hardware and a new database engine. In my experience that combination is exactly where moves go wrong.
When
- 30th Nov – 2nd Dec: Meticulous Migration Planning, Contention Handling, Reviews and Modifications and lots of coffee.
- 2 Dec, 07:01 IST: Plan approved.
- 2 Dec, Evening: New server bought.
- 2 Dec, 21:35 IST: Server locked down (key-only login, firewall on).
- 3 Dec, Morning: Trial copy of production data into PostgreSQL. All 151 tables matched.
- 3 Dec, 14:03 IST: Full rehearsal of the switch. 6 minutes, nothing touched in production.
- 3 Dec, 15:01:38 to 15:02:45 IST: The real switch. 67 seconds.
How: Six habits that made it boring
1. Prove the copy. Don’t trust it.
We built one copy tool and gave it one job: copy every table, then compare every table, by row count and by a fingerprint of every primary key. Before anything moved, it ran as a read-only report against production. That report found 7 problems, among them two columns too long for PostgreSQL’s stricter rules and rows still pointing at users who had been deleted. Six we fixed in code. For the seventh, 124 inbox items belonging to deleted users, I made the call to leave them behind. The next report came back clean.
2. Rehearse the real switch, on real data.
The switch was one workflow with two modes. REHEARSE runs every step of the real move against real data and times it, without touching the live server. SWITCH is the move itself. The rehearsal took 6 minutes and passed, so on the day there was nothing new to learn.
The setup work for that rehearsal had already earned its keep. Our first run of the new server’s setup job finished green, but it had quietly never started the web app. A green tick that hides a stopped app is exactly what bites you at 2 AM. We found it in the build-up, fixed it, and added a check for it, well before it could matter.
3. Do the slow work before the clock starts.
Moving 2.2 GB of uploaded files takes minutes, and you don’t want those minutes inside your downtime. So the files were copied while the old server was still serving customers, and each later run copied only what had changed. When the real switch ran, the file copy found 0 files left to move.
4. Keep DNS out of switch day.
DNS changes take hours to spread and you cannot pull them back quickly. So we didn’t touch DNS at all. The old server’s front door, its web proxy, was changed to forward traffic to the new server. Customers kept the same address. For 67 seconds they saw a short “moving, back shortly” page, and then the app was back, served from the new machine. DNS moves later, calmly, once the new server has proven itself.
5. Make rollback automatic, and keep the old server whole.
If any step had failed before traffic was forwarded, the workflow would have put the old server back exactly as it was, by itself, without anyone typing a command. After the switch the old server was stopped and set never to restart on its own, so two copies of the app can never write at the same time. It is still there, untouched, as our fallback. Nothing was deleted.
6. Make the wrong thing impossible, not just discouraged.
The switch leaves a marker on each machine: “moved” on the old one, “live” on the new one. Our deploy pipeline reads them and refuses to deploy to the old server once it has been moved. Nobody has to remember which server is production. The system will not let anyone get it wrong.
The honest part: what went wrong
It was not zero errors, and I would not trust anyone who promises that. Nearly all of ours were caught before the move, in places where they could not hurt anyone. One slipped through, and we found it ourselves.
- The copy report found 7 data problems. All were dealt with before the trial copy.
- A setup run reported success while the app had not started. Caught and fixed before the switch.
- One gap did get through. After the switch, our video maker was off on the new server because one setting had not been carried across. We found it in our own check after the switch, and it was back on with the next deploy, the same day.
- Our test pipeline hit a time limit on one run, and one of the test machines dropped off the network. That one was me: I took my laptop, which runs part of our test fleet, into a meeting on my phone’s 5G. The pipeline re-ran the failed parts and held the merge until everything was green again.
Nearly every one of these was caught by a check built to catch it, somewhere safe, before a customer could feel it. That is what a smooth migration really is. Errors still happen. They just happen in places where they can’t hurt anyone.
What I would tell you
- Break the move into steps that can each be undone, and prove each one before you start the next.
- Compare the data, every table, every time. “The copy finished” is not proof.
- Rehearse the real switch, timed, on real data.
- Do the slow work, like files and checks, before the downtime window.
- Keep DNS out of switch day.
- Make rollback automatic, and make the wrong deploy impossible.
Groundswell now runs on a server with eight times the memory and a database built for many writers at once. After 85+ migrations in my 25+ years of career, this is the first one I would happily do again tomorrow. Next time your team plans a migration weekend, plan a rehearsal instead.