BLOG 9 min read

Server migration with minimal downtime: how we move servers while they keep running

In October 2026 we moved our production services – our customers’ applications as well as our own products – to a new server while they kept running. No big bang, no lost data, and only a short, announced pause for each service. Here is the method behind it, in plain language. If you want the technical depth, open the “In detail” sections.

Why a server has to move at all

Servers age. Disks wear out, operating systems drop out of support, and what was good enough years ago is not good enough today. So our production server in the data centre was due to be rebuilt from the ground up – on a sturdier foundation whose configuration lives entirely in code.

The catch: you cannot re-lay a floor while the furniture is standing on it. A server that runs software cannot be reinstalled. So the software moves out for a while – onto an interim server – and moves back in after the renovation.

For a business whose software we run, “migration” mostly means risk. An ordering portal or an app that is unreachable for an hour costs orders and trust. That is why a migration, for us, is not a night shift with crossed fingers but a procedure with fixed rules.

Five rules that govern every step

  1. Back up first, then move. Before the first service moves, a complete backup exists outside the data centre – and we have restored it as a test.
  2. One service at a time. Never everything at once. The next service only goes once the previous one runs stably.
  3. Only ever one copy that changes data. At no point do two servers accept orders, logins or uploads for the same service.
  4. Every step has a way back. If something goes wrong, the previous state is restored in a single move.
  5. Every stage ends in a stable state. We can stop after any step without leaving anything half-done. No step is skipped to keep to a schedule.
Diagram: the previous server is first backed up completely. In stage 1 the services move one at a time to an interim server; in stage 2 they move back one at a time to the rebuilt server.
The move in two stages: first onto an interim server, then back onto the rebuilt server – one service at a time. Before anything moves, everything is backed up and the restore is tested.

Step 1: Back up first – and prove the backup works

A backup that has never been restored is a hope, not a backup. So a migration with us does not start with the migration. It starts with a complete copy of all data and settings in a second location, outside the data centre.

Then we rehearse the opposite: we restore databases from that backup in an isolated test environment and compare them with the original. Only when the numbers match may the first service move. Along the way, this inventory shows whether the running backup really covers everything. If something is missing, that gets fixed first.

In detail

How we check a backup

  • Databases as dumps, not file copies. Every database is exported from the running instance in a transactionally consistent way. Copying live database files would be a gamble.
  • Pull, don’t push. The backup server fetches the data with its own read-only key. The production server has no access to the backups – whoever takes it over cannot delete them.
  • Checksums. The archive is written in chunks, each with a SHA-256 checksum, and read back and compared after writing.
  • Restores in throw-away containers. One database of each type in use is restored in containers without network access. We compare the row counts of the largest tables, and the number and size of files, with the original. The test environment is deleted afterwards.
  • Report, don’t abort. If a connection drops, the pull job retries and carries on with the remaining targets. At the end there is a list of what failed – instead of silence.
  • Backed up from day one. The interim server is part of the nightly backup before the first service moves in.
Diagram: a backup server outside the data centre pulls database dumps and files from the previous server, and every night from the interim server, and writes an archive with checksums; a restore test plays it back and compares it with the original.
Backup with restore test. Click to enlarge.

Step 2: The new home is inspected before anyone moves in

We do not set up the interim server by hand. It is built entirely from versioned code: system settings, firewall, web server, monitoring. Every change is reviewed before it is applied. So it is always clear what runs on the server – and why.

Then comes the inspection, like a handover of a flat: are the disks healthy? Are only the doors open from outside that should be open? Do logs and metrics arrive in monitoring? Is the backup running? A server that fails this check goes back – however tight the schedule.

In detail

What a server acceptance check covers

  • Disks: SMART values, wear and error logs of every drive; the mirror (RAID 1) is fully synchronised.
  • Two firewall layers: one in front of the server, one on the server itself, both with the same list of allowed ports. Checked from outside, port by port.
  • Access: key-based login only, no direct root access, no passwords; repeated failed attempts lead to a ban.
  • Patching: security updates are installed before the first service, then automatically – but without automatic reboots in the middle of operation.
  • Observability: logs and metrics flow into our monitoring from day one, including disk health and certificate expiry.
  • Current runtime: container runtime and web server at current versions. The applications themselves stay unchanged – more on why below.

Step 3: One service at a time

The order is no accident. Small services and our own products move first, paying customers’ systems last. If there is a surprise, it hits us – and it is fixed before a customer system’s turn comes.

Every single move follows the same sequence:

  1. We set up the service on the interim server in advance and copy its files while it keeps running on the previous server.
  2. We stop the service. This is where the short pause begins.
  3. The final changes are transferred, and we compare both sides.
  4. We switch on the forwarding and start the service on the interim server. The pause ends.
  5. We check the service from outside, the way your users see it, and watch it for half an hour. Only then does the next service go.

We planned for up to 30 minutes of pause per service; most services were reachable again after a few minutes. The moves took place in the evenings and at the weekend, and customers whose systems were affected knew in advance.

Sequence diagram in eight steps between Cloudwerks, the previous server, the interim server and users: set up in advance, stop, transfer and compare the last changes, switch on forwarding, start, pass the request on, watch for 30 minutes.
One service moves. The pause lies between step 2 and step 5; afterwards users reach the service as usual, through the previous server’s forwarding.
In detail

The cutover of one service, step by step

  • Configuration from Git, with a diff. The service is rolled out on the new server from its versioned recipe, still without a public route. We compare the generated configuration with the one actually running on the old server. Every difference has to be explained.
  • Same versions. The same container image, the same major database version. Upgrades are separate changes with their own tests, not part of the move.
  • Pre-sync. Files are copied in advance while the service runs. During the pause only the difference has to be transferred – which keeps the pause short.
  • Cold copy. During the pause the service is stopped completely, a fresh database dump is taken and the final state is transferred. Then we compare row counts, file counts and checksums.
  • Forwarding first, then start. That way even the very first certificate request reaches the new server, not the old one.
  • Check like a user. We call the service over the public internet and check the certificate and the key functions, not just the internal status.
  • 30 minutes of observation: status codes, errors in the logs, restarts.
  • Remove, don’t delete. On the old server the containers are removed so a second instance cannot start by accident. Data, images and configuration stay in place as the way back.
  • The way back: take the host name off the forwarding list and start the old service. If the service has already accepted data on the new server, that data is transferred back first.
Sequence diagram of one service cutover in eleven steps, from the rollout out of Git through pre-sync, stop, dump and comparison, forwarding and start, to observation and removing the old stack.
The cutover of one service as a sequence. Click to enlarge.

Step 4: The address stays – the old server forwards

The trickiest part of a migration is not the copying but the address. Every website and every app is found by a name, and the internet’s address book, DNS, translates that name into a server’s number. If you change an entry there, the change does not arrive everywhere at once: many networks remember the old number for a while.

If you simply switched the address, for a while some users would land on the old server and others on the new one. Both would accept orders – and afterwards there would be two versions of the truth that can no longer be merged cleanly.

We turn it around. The address stays as it is for now. Instead, the previous server gets a kind of mail-forwarding order: requests for a service that has moved are passed on, unchanged, to the interim server. Every user ends up in exactly one place, whatever their network remembers. We only change the address book at the very end, in a single step, once every service runs stably. Even then the old server keeps forwarding stragglers until none are left.

Diagram: users look up the familiar address and arrive at the previous server. Its reception serves service B, which has not moved yet, and passes requests for service A on to the interim server. The old copy of service A stays stopped as the way back.
During the move: one address, one destination. For services that have moved, the previous server passes requests on; the old copy stays stopped in place – as the way back.
In detail

How the forwarding works technically

  • Forwarding at TCP level. The old server’s reverse proxy decrypts nothing. It only reads the requested host name (SNI) and passes the encrypted connection through unchanged (TLS passthrough). Encryption ends on the new server.
  • Real client addresses. Through the PROXY protocol (version 2) the new server learns the user’s IP address instead of the old server’s. It trusts that information only when it comes from the old server. Logs, ban lists and applications keep seeing the real sender.
  • Certificates without detours. The new server orders its own TLS certificates. The certificate authority’s validation connection (TLS-ALPN-01) also runs through the forwarding; the certificate is in place seconds after the start.
  • One entry per service. The forwarding is a list of host names in a file the proxy reloads without a restart. Switching means adding a name. Switching back means removing it.
  • Rehearsed first. Before the first real service moves, we run the forwarding through with a test service under its own name: certificate, real client IP, switching back.
  • DNS last. The records’ time to live (TTL) is lowered to five minutes in advance. The switch happens once, when every service has moved and runs stably. Afterwards we check the answers of several public resolvers and watch the forwarded connections on the old server die down.
Diagram: the client resolves the name via DNS and connects over HTTPS to the previous server’s reverse proxy. It routes service B over HTTP and passes connections for service A via TLS passthrough by SNI with PROXY protocol v2 to the interim server’s reverse proxy. The certificate authority validates via TLS-ALPN-01 through the forwarding.
Forwarding at TCP level: at any time there is exactly one writable copy. Click to enlarge.

Step 5: The old server stays in reserve

After the move, the previous server is not wiped right away. It is only switched off and stays untouched until several conditions hold: the new server has run for a few days without incident, its nightly backups are complete and one of them has been restored as a test, and the final archive of the old server is complete. Only then is it released for the rebuild. Until that point, switching it back on is the last way back – and it is available at any time.

What we deliberately do not do during a migration

  • No “everything in one night”. Moving every service at once and then switching the address would be quicker to plan. It also turns every small mistake into a big one.
  • No new features on the side. During the move the applications stay as they are: same version, same database. Whoever migrates and upgrades at the same time cannot tell, when something breaks, which of the two caused it.
  • No manual work on the servers. Every change comes from the repository, is reviewed and logged with a timestamp. That makes every step repeatable – and traceable, should anyone ask.
  • No new releases during the move. A release freeze applies for the duration. The state that moves is the state that arrives.
  • No deadline pressure. “As far as we get” is a legitimate goal. If a step takes longer, the next one waits. Because every stage ends in a stable state, a delay costs time, not availability.

What comes next: stage 2

The interim server is exactly that – interim. While it carries the services, we rebuild the server in the data centre. Then the services move back, using the same method in reverse: again one at a time, again with forwarding, this time from the interim server over an encrypted connection to the rebuilt server. Once the last service is back, the interim server is wiped and cancelled.

In detail

How stage 2 is planned

On the rebuilt server, a firewall is the only system in direct contact with the internet; its configuration lives as code in Git. Behind it sit separate zones for public applications, internal management tools and backups. Only explicitly allowed connections are possible between them. As in stage 1, the backups are pulled from outside.

Every service is rehearsed in a separate test environment before it returns. The switch works as before: a host name on the interim server’s forwarding list, then DNS follows – this time one service at a time.

Diagram: the interim server’s reverse proxy forwards one service at a time over an encrypted tunnel to the rebuilt server’s edge firewall. Behind it sit separate zones for applications, management and backup; off-site copies pull the backups.
Stage 2 as planned: the same method in reverse. Click to enlarge.

What this means for you

If we host your software in our data centre, this method applies to your system too – for every move, every hardware replacement and every larger infrastructure change. In practice, that means:

  • You know in advance when your system moves and the longest the pause can last.
  • Before anything moves, there is a tested backup of your data.
  • Every step has a way back, and the old state is kept until the new one has proven itself.

And if you are facing a migration yourself – off an old server, into a data centre or into the cloud: the rules apply no matter who is moving. Reviewing or drawing up a migration plan that works while operations continue is part of our architecture advisory.

For the first conversation

Three details help: which systems should move, who uses them when – and the longest each of them may stand still. With that we can assess in the architecture call what a migration could look like for you.

Frequently asked questions about server migration

Can a server migration happen with no downtime at all?

Services that store data usually need a short pause. It is the only way to be sure no change gets lost during the switch. The pause can be cut to a few minutes if the data is copied in advance and only the final changes are transferred during the pause. Doing it with no interruption at all requires an application built for it, for example with replicated databases – a question of architecture, not of the move.

How long does a server migration take?

It depends on the number and size of the services. For us, the first stage took one weekend, and switching a single service usually took minutes. On top of that come the preparation, the backup with its restore test, and a few days of observation before the old server is released.

What happens if something goes wrong during the move?

We undo the step: forwarding off, and the service starts again on the previous server, whose data has stayed untouched. If the service has already accepted data on the new server, we transfer it back first. Because only one service moves at a time, a problem never affects more than that one service.

Do I have to do anything as a customer?

Usually not. Your address and your logins stay the same. Only if you manage your system’s name in your own domain do we agree a single DNS change with you – at a time that suits you.

All posts

The next step is always the same.

A 30-minute architecture call. You describe the bottleneck, you get an assessment of whether and how it can be solved – whether or not you hire us.

30 minutes · free · directly with the architect who builds