Cloudverg Console
PricingDocsSign in
Docs menu

VergShip

Move a site to another server

A move replaces a hand-built site on an old server with a VergShip app on a new one, without a silent gap and with a way back at every step. The work is a short list of signed commands you run on your own computer. The console shows the app's state and prepares each command for you, but it holds no operator key, so it never signs or runs one itself. Every request is checked again on the server.

This page is the move itself. The verg.toml format is under Apps, the keys and permits under operations, and env files and secret files under sealed secrets.

Before you start

  • The agent runs on both servers, and root on the new one allowed operations for this app (--apps NAME). Root on the old one allowed the app and the old units it lists (--apps NAME --verbs "legacy.stop legacy.start", then sudo verg-agent ops legacy NODE APP UNIT,UNIT).
  • The new server's main Caddyfile has one line, once: import /etc/caddy/verg.d/*.caddy.
  • The app exists on the new server (verg app create), and its secrets are sealed to the new server (verg secret push). A site behind Cloudflare with a certificate that cannot be issued until DNS moves uses tls = "files" and an Origin CA certificate, sealed as secret files.
  • The old site is not changed by any of this until you deliberately stop its units.

The app verbs

VerbWhat it doesCommand
app.previewBuilds a commit and starts it beside the live release, held for the minutes you name, reachable over VergMesh only. Nothing goes live.verg app preview NODE APP --commit SHA --minutes 60
app.switchTakes a release held in a preview live: checks its health path, points the site at it, drains the old slot.verg app switch NODE APP --release RELEASE
app.discardRemoves a release held in a preview. The live release and the one before it are never touched.verg app discard NODE APP --release RELEASE
app.stopStops the live slot and the timers, and keeps them stopped across a reboot. The releases, the storage and the site stay, and the site answers an error.verg app stop NODE APP
app.startStarts a stopped app again and waits for its health path.verg app start NODE APP
legacy.stopStops and disables one unit of the old site that root listed for the app, and writes down what it was.verg ops legacy NODE APP --unit UNIT --stop
legacy.startPuts that unit back exactly as it was: enabled if it was enabled, running if it was running.verg ops legacy NODE APP --unit UNIT --start

Some old sites also keep a service in a Docker container beside their system units. For those, the same legacy verbs work on a container by name: verg ops legacy NODE APP --container NAME --stop (or --start) runs docker stop or docker start under a time limit, and the answer says the state Docker reports afterwards. Root on the old server names the app with --apps and the verbs with --verbs "legacy.container.stop legacy.container.start". A name that is not a container on that machine, or one of VergShip's own containers, is never touched.

The move, in order

  1. Deploy the code the old site runs. Name the commit that is live on the old server, so the new app is the same program and the same release task.
    verg app deploy apps suddengone --commit SHA
  2. Preview before you trust it. Build the same or a newer commit in the idle slot and test it over the mesh, through the preview address and its certificate. Nothing public changes.
    verg app preview apps suddengone --commit SHA --minutes 120
  3. Copy the database. Count the rows first, so you have a list to compare. Then wait for the old app's crons to be quiet, freeze writes, take the final copy, and thaw. A final copy needs the source frozen, so the row counts of the copy must equal the source's.
    verg db count old-server suddengone kinfold
    verg db freeze old-server suddengone kinfold --minutes 30
    verg db copy old-server apps suddengone kinfold --mode final
    verg db thaw old-server suddengone kinfold
  4. Copy the storage. The app's writable folder goes the same way, with its file list checked.
    verg storage copy old-server apps suddengone
  5. Switch the traffic. Either take the preview live, or deploy the commit on the new server and move DNS. With DNS, change both the A and the AAAA record, or Cloudflare keeps reaching the old server over IPv6.
    verg app switch apps suddengone --release RELEASE
    # or, when DNS carries the traffic:
    verg app deploy apps suddengone --commit SHA
  6. Watch the new site. Its Caddy log should show the requests that used to arrive on the old server, and the health path must answer. Its timers run on the new server now.
    verg app status apps suddengone
    verg app logs apps suddengone --source app
  7. Stop the old units. When the old server's log has been quiet long enough, stop its web unit and its timers. VergShip records what each one was, so a rollback can put them back.
    verg ops legacy old-server suddengone --unit kinfold-cron.timer --stop
    verg ops legacy old-server suddengone --unit kinfold-backup.timer --stop
    verg ops legacy old-server suddengone --unit kinfold-web.service --stop

Going back

Each step has its own way back, smallest first. Switch the app back to the release that was live before (verg app rollback, or verg app switch to a held release). Start the old units again (legacy.start). Point DNS at the old server again. If writes already landed on the new database and you must go back, copy it back the other way and compare the counts, then start the old units. A database is never rolled back by a code rollback.

verg app rollback apps suddengone
verg ops legacy old-server suddengone --unit kinfold-web.service --start
verg ops legacy old-server suddengone --unit kinfold-cron.timer --start
verg ops legacy old-server suddengone --unit kinfold-backup.timer --start

verg app discard ends a preview without going live. verg app stop takes the new app down at the end of a move without deleting anything. Neither one touches a database.

What the console does and does not do

On the app's page, the Move card shows whether the app is stopped, the preview window that is open and when it ends, and the old units the app has asked about. Each control there prepares the exact command for you to run; it does not sign or run it. This is the same rule as every other VergShip operation: a stolen console session, or the console itself, can read the state and prepare text, but it cannot make a server change anything, because only an operator key on your own computer can sign a request that a server pinned there accepts.