Skip to content
← All posts

Replacing software while it keeps running: this site, v2 → v3

· 7 min read
Modernization Migration Legacy Software DevOps Architecture

You have software that works. It takes orders, holds your customer records, runs your reports. It's also old and slow, and nobody wants to touch it. Every quote you've had to replace it comes with the same plan: build the new system off to the side for months, then pick a weekend, move the data, switch over, and hope.

That plan is scary because it is all-or-nothing. If Monday morning goes wrong, there's no old system to go back to, and the data has already moved.

There's another way: the new system runs beside the old one, on the same data, and takes over when it's ready. At every step there is a short, written way back. We're doing exactly this with this site. This post shows how it works, including the parts that went wrong.

What we're replacing

The version of this site that has been serving visitors ("v2") is a single Rust program. It serves the public site and the blog, an admin dashboard, a chat assistant, and two AI endpoints (MCP servers). One is public, so any AI assistant can look up what we do. The other is private, and it's how posts like this one get published.

The new version ("v3") is a different stack altogether: TypeScript on Bun, an Astro site, and a separate admin app. It isn't a coat of paint. It's a rewrite of every part a visitor, an admin or an AI client touches.

What stayed the same is everything people already depend on: the database, the content in it, the addresses, and the public AI endpoint at /mcp. That last one matters more than it looks. Its URL is printed in published blog posts and saved in other people's AI tool configurations. If it broke, the website would look fine and nobody would notice until a client did.

Side by side, on the same data

Web server (nginx) one line decides who is public v2 (old) still installed · one command to start v3 (new) site · admin · admin MCP, own services One production database v3 only adds tables; v2 never sees them

Both versions installed on the same server, both reading the same data. Only the web server's routing decides which one visitors get.

The new version was installed next to the old one on the same server, as its own set of services: one for the site, one for the admin, one for the admin's AI endpoint. It got its own preview address, so we can click through it while the old site keeps serving everyone else.

The decision that made the rest safe: v3 reads and writes the same production database as v2, and it is only allowed to add to it. v3 needed four new tables, and it got them. It did not rename, reshape or drop anything v2 uses. To v2 the database looks exactly as it always did, because the new tables are invisible to code that never asks for them.

That one rule pays off three ways:

  • No data migration. The posts, case studies, contact messages and settings were already where v3 needed them. Nothing was exported, transformed or re-imported.
  • Both versions are always current. Publish a post through either one and it appears on both, because there's only one copy.
  • The way back stays open. Since v2's view of the database never changed, v2 could take over again at any moment.

Sharing a live database during a preview has a catch, and we wrote it down before it bit. Every click we make reviewing v3 would land in the same visitor statistics as real traffic. So while v3 is in preview, its analytics are switched off by a single setting, and turning them back on is a written step of the switch-over.

Proving the new one does the same job

"It looks right" isn't evidence. Before the new version takes any public traffic, it has to show it matches the old one where it counts.

Same answers, checked against the old system. The site has a pricing engine behind it. We captured its output from the live v2 and turned it into test fixtures. On every change, v3's output is compared byte for byte against what v2 actually said. Close isn't good enough.

Same database shape. A test builds a fresh database from the migration history and checks that v3's code agrees with it, so the code can't drift from the real schema without someone noticing.

Same contract for the outside world. v2's public AI endpoint had 12 tools. v3 ported all of them and added 3. After every deploy, the pipeline asks the live endpoint for its tool list and fails if fewer than 15 come back.

These run on every change, against a real PostgreSQL database rather than a mock, and nothing deploys unless they pass.

Checks that prove the right thing

A health check that only asks "did the server answer?" will happily pass while serving the wrong thing. Ours had to be stricter, because during a side-by-side rebuild there's a perfectly healthy wrong thing right there: the old version.

So after each deploy, the pipeline checks for content only v3 renders. A bare "200 OK" would pass against a default web-server page, or against v2 before the switch.

We learned the same lesson from smaller things. One early deploy check stayed green while the file it was meant to upload was empty. Another time, a step tried to run code that hadn't reached the server yet. Each was caught and fixed before it hurt anyone, and each one became a check: a green light has to prove the artifact is intact, not just that a process started. Even the site's headline font gets checked now. The pipeline downloads it and confirms it really is a font file, because a missing font doesn't break the page. It just quietly makes it look wrong.

Small, separate, automatic releases

There's no "release day" to dread, because nothing is ever deployed by hand. Merging a change to the main branch builds it, tests it and ships it.

The site and the admin deploy separately, so a wording change on the site can't redeploy the admin, and the reverse. A change to code both of them share deploys both. Each release is small, which keeps it easy to check and easy to reverse.

Building it went the same way. The core was built in phases: foundations, then the site, then the public AI endpoint, the chat, the admin, the admin's AI endpoint, and finally the deploy pipeline. After that came a steady run of small improvements, about eighteen merged changes in all. Each one shipped on its own while visitors kept using the site.

The switch, and the way back

Once v3 has proved itself on its preview address, the switch-over is a short checklist, written down before it's needed:

  1. Point v3's settings at the real domain and turn its analytics back on.
  2. Send the public domain to v3 instead of v2: a change to the web server's config (and any DNS records that need to follow), then a reload.
  3. Stop the v2 service.

There's no data step, because the data never moves. The deploy pipeline doesn't care either: it ships to the same place either way, and only the web server decides who's public.

The way back is written down in the same file:

# bring the old version back
sudo systemctl start mcsoftsolution
# point the public domain back at it (one line of nginx config), then:
sudo nginx -t && sudo systemctl reload nginx

Nothing needs undoing in the database, because v3 only ever added tables, and v2 doesn't know they exist. Stopping v2 doesn't delete it. It stays installed and untouched for as long as the way back might be needed, so rolling back is two commands, not a crisis meeting.

What this means for your software

You don't need a Rust website for any of this to apply. The approach carries over to an old order system, a desktop app the office depends on, or a back end that one person understands:

  • Run the new system beside the old one. Not instead of it, and not in a lab somewhere.
  • Share the data, and only ever add to it. No migration weekend, and the old system keeps working.
  • Prove it matches the old one on the outputs that matter, using real recorded answers.
  • Check for the right thing. Make every check prove that the new system is the one answering.
  • Ship small, automatically. No release day.
  • Write the way back down before you need it. If going back can't be done in a couple of commands, that has to be fixed before the switch.

If your software works but nobody wants to touch it, show us the job. We'll tell you which piece we'd replace first, and how you'd get back if you didn't like it.