Skip to content

Services Host Migration Plan

Status: done, 31 October 2026, with a narrower scope than drafted (ADR-041). §0 records what was done and what's left. §1 to §9 are the 27 October draft, kept as written. Expands: ADR-030 and the runbook in 02 System Architecture §16.4. Decision: ADR-041.

0. What was done, 31 October 2026

Scope (Andrew)

Moved to thinklio-nbg1 (91.98.73.218) Stayed on apps-nbg1 (178.104.2.63)
notion-mcp, xero-mcp, cliniko-mcp, deputy-mcp, asana-mcp, seo-service, research (v1, to retire), research-v2 (with data), ormon (with data), pocketbase-mcp pt-bot, fallbot, cliniko-mirror, pocketbase-fall, ripplebase-api, foot-camera-backend, pilbara-therapy-backend, hermes, Directus, PocketBase Novansa

All ten answered /health with a valid Let's Encrypt certificate at their public URLs at 11:42 UTC. research-v2 came up with its 308 jobs and caches, and ormon with its database. asana-mcp lost its www.asana.api.thinklio.ai domain, which had no DNS record.

How (as done)

The apps build on builds-nbg1, which pushes to ghcr.io/schox/*. The server pulls. Only the primary server's deployment pushes.

Stateless apps (all but the three below), in Coolify, keeping each app's ID, env vars and watch paths:

  1. Servers → add thinklio-nbg1 → Make primary → the top-right Deploy button.
  2. Test on the new box before DNS: curl -k --resolve <domain>:443:91.98.73.218 https://<domain>/health.
  3. Point the A record at 91.98.73.218 at once, then Restart the app, so Traefik asks for the certificate while DNS points at it.
  4. After 5 minutes (the TTL), Remove apps-nbg1 from the app's Servers.

Apps with data (ormon, research-v2). Coolify won't give an app with a persistent volume a second server, so the volume entry is taken off for the switch:

  1. Stop the app. Point DNS at thinklio-nbg1 while it's stopped, so the certificate comes on first start.
  2. On apps-nbg1, tar each volume to /root/move/<name>.tgz, the rollback copy.
  3. From the coolify bastion, copy the files across the private network with Coolify's own server keys (/data/coolify/ssh/keys/, port 2222), and check the sha256 sums.
  4. On thinklio-nbg1, docker volume create with the same name and the same four com.docker.compose.* labels (the config-hash too, so Compose adopts the volume rather than recreating it), then untar into it.
  5. In Coolify: delete the storage entry, add thinklio-nbg1, Make primary, Remove apps-nbg1, add the storage back under the same name (the UI prefixes the app's ID), check the name, then Deploy. Never two ormons: apps-nbg1 was detached before ormon started.

pocketbase-mcp has no registry image, so it was cloned (Resource Operations → Clone, a new app ID w6wht3ua1s2dlle9gn5dbuz1). Its Cloudflare proxy was off while the certificate was issued, then back on. Renewals work through the proxy: the old copy renewed that way on 3 September. The old app was deleted.

What went wrong

  • DNS changed before deploying. Five apps' A records went to thinklio-nbg1 before they ran there: about ten minutes of 503s (from about 08:10 UTC), then reverted.
  • The Deploy button on the apps-nbg1 row deploys only to that additional server, which never pushes, so its pull fails with "not found". The top-right Deploy deploys the primary.
  • Let's Encrypt's limit. Traefik retries the certificate for every domain it lacks on each container change on the box. While a domain still points elsewhere, each retry is a failed authorisation, and five in an hour blocks that hostname for the rest of the hour. cliniko, seo and research hit it: cliniko-mcp served Traefik's default certificate, which the bots reject, from about 08:34 to 08:55 UTC. Hence step 3 above: DNS straight after the direct test.
  • The wrong clone. The first clone took the PocketBase Novansa service, which sits beside the pocketbase-mcp app in the Apps project. It was deleted before it ran. pb-mcp.novansa.com returned 503 from about 09:50 to 11:37 UTC, because its DNS had already moved.

Left to do

  • Tidy-up, about 7 November 2026. Delete /root/move on both boxes and the old ormon and research-v2 volumes on apps-nbg1. Commands and checks: thinklio-services docs/66-thinklio-nbg1-move-follow-ups-v01.md.
  • Telemetry and health checks (deferred by Andrew). Whether Prometheus on analytics-nbg1 points at anything on apps-nbg1, a /health probe per service, and Coolify health checks on the moved apps, most of which show running:unknown (§7.1).
  • DataForSEO. seo-service now calls from 91.98.73.218: add it if DataForSEO's dashboard has an IP allow-list.
  • Traefik on thinklio-nbg1 is 3.6.10 (§3.3 wanted the latest 3.6 patch first; it wasn't done).
  • apps-nbg1 (§7.5) and retiring research v1 (§3.6), as before.

1. What we're doing

Every app built from the thinklio-services repo moves from apps-nbg1 to thinklio-nbg1, and so does ormon, the OpenRouter spend monitor (Andrew, 27 October 2026). ADR-030 named four services in June. The fleet is now 11 apps, plus the PocketBase behind the Cliniko mirror, plus ormon.

Box Hetzner type Specs (published) Role after the move
thinklio-nbg1, 91.98.73.218 CPX32 4 vCPU, 8 GB, 160 GB thinklio-services and ormon
apps-nbg1, 178.104.2.63 CPX22 2 vCPU, 4 GB, 80 GB The other products' backends and the ad-hoc apps

The service URLs don't change, only the box behind them, so no client changes anything. Each move is a redeploy on the new box, then a DNS change.

2. Inventory

From Coolify on 27 October 2026. All domains are A records to apps-nbg1 with no Cloudflare proxy.

Stateless: redeploy and repoint

Coolify app Coolify project Domain DNS zone
notion-mcp Thinklio notion.api.thinklio.ai Cloudflare
xero-mcp Thinklio xero.api.thinklio.ai Cloudflare
cliniko-mcp Thinklio cliniko.api.thinklio.ai Cloudflare
deputy-mcp Thinklio deputy.api.thinklio.ai Cloudflare
asana-mcp Thinklio asana.api.thinklio.ai (and www.asana.api.thinklio.ai, which has no DNS record) Cloudflare
seo-service (DataForSEO) Thinklio seo.api.thinklio.ai Cloudflare
research (v1) Thinklio research.api.thinklio.ai Cloudflare
fallbot FALL fallbot.footanklelowerlimb.com.au not Cloudflare: nameserver.net.au
pt-bot Pilbara Therapy pilbara-bot.novansa.com Cloudflare
cliniko-mirror FALL none (no public domain) —

cliniko-mirror has no volume. It writes everything to the FALL PocketBase (PB_URL), so it's stateless, but it depends on pocketbase-fall (§3).

Keep data: copy it across

Resource Data Notes
research-v2 (app, Thinklio) Volume at /data: the job database and River queue (SQLite), the model and search caches, and the fetched texts Litestream can stream the databases to object storage, but not the texts (its docs/deployment.md). RippleBase is its consumer, by webhook
ormon (app, Thinklio; repo openrouter-monitor) Volume at /data: ormon.sqlite, the spend history Holds the OpenRouter management key and can stop or disable keys. Domain ormon.novansa.com (Cloudflare)
pocketbase-fall (Coolify service, FALL) Volumes pb_data and pb_hooks The Cliniko mirror's database, so patient data. Built from services/pocketbase-fall

Staying on apps-nbg1

Not from thinklio-services: ripplebase-api, foot-camera-backend, pilbara-therapy-backend, hermes, pocketbase-mcp (tokenscompany/pocketbase-mcp), Directus, and PocketBase Novansa.

3. Check before moving anything

Next session, before the first move. Items marked (Andrew) need Andrew's terminal or a dashboard.

  1. Load. Sentinel metrics on apps-nbg1 for at least a day, to confirm the fleet fits in 8 GB with headroom. Sentinel is off on apps-nbg1; on thinklio-nbg1 it's on with Metrics off. (Andrew: Coolify → Servers → Sentinel and Metrics on both.)
  2. The state of thinklio-nbg1. Coolify shows nothing on it, but the retired Go API ran there. docker ps -a, docker volume ls, df -h and a look at /data or /opt for leftovers. Then decide between cleaning up and a Hetzner rebuild with a fresh image, which ADR-030 suggested. A rebuild means re-adding the box to Coolify. (Andrew, ssh via the bastion.)
  3. Network and firewall. thinklio-nbg1 accepts 80 and 443 from the internet (Let's Encrypt over HTTP-01 needs 80) and is on the private network. Its Traefik is 3.6.10; update it to the latest 3.6 patch before moving anything.
  4. Apps that call each other by internal name. This is the most likely way a move breaks something. Apps on one box can reach each other by Docker container name; across boxes they can't. Check every moving app's environment values for internal hostnames, not public URLs. Above all, cliniko-mirror's PB_URL (to pocketbase-fall), and whatever research-v2 uses to reach ormon or RippleBase. Coolify's API only shows the names, so Andrew reads the values in the Coolify UI, never pasted into a session.
  5. Background work. For each app, check whether it does anything on a schedule or a loop, besides answering requests. Two running copies of such an app would both do it. Known: cliniko-mirror syncs, research-v2 runs jobs, ormon polls and acts. Check: the two bots and research.
  6. research v1. It's still registered as production next to v2. Is anything still calling it? If not, retire it instead of moving it.
  7. pocketbase-fall. It holds patient data. Decide whether it moves now with its mirror, or later. Moving it now means one move for the mirror and its database together. Its host doesn't change who can reach it.
  8. DNS TTLs. Lower each record's TTL to 60 seconds a day ahead, so a rollback takes a minute. For fallbot, at the footanklelowerlimb.com.au DNS host. (Andrew)
  9. How Coolify moves an app. Find out which of these this Coolify version offers: adding thinklio-nbg1 as a further server for an app, cloning the app to a destination on the new box, or creating it there afresh with the same repo, build settings, watch paths and environment. The first two keep the environment, so nothing has to be re-entered.

4. Cut-over, by kind of app

Stateless and request-only (the MCP servers, seo-service, research)

  1. Deploy the app on thinklio-nbg1. Leave the old one running.
  2. Test the new one directly, before DNS changes: curl --resolve <domain>:443:91.98.73.218 https://<domain>/health (and /meta). The certificate can't be issued until DNS points there, so use -k for this check only.
  3. Point the A record at 91.98.73.218. Traefik gets the certificate on the first request, typically within a minute. Requests in that minute may fail TLS.
  4. Check /health, /meta and one MCP tools/list at the real URL. make health in thinklio-services probes everything in registry.yaml.
  5. Stop the old app, but keep it in Coolify for a week as the rollback.

Stateless with background work (the bots, cliniko-mirror)

As above, except: stop the old app, then change DNS and start the new one. That's a gap of a minute or two, and no double-acting. Telegram retries a webhook it couldn't deliver, so the bots lose nothing. cliniko-mirror catches up on its next sync.

With data (research-v2, ormon, pocketbase-fall)

  1. Agree a time. For research-v2, tell RippleBase's session, and wait until no job is running. For ormon, tell the projects in its docs/for-clients.md that spend goes unwatched during the move. For pocketbase-fall, stop cliniko-mirror first so nothing writes.
  2. Stop the old app.
  3. Copy the volume to the same volume name on thinklio-nbg1 (docker run --rm -v <vol>:/v alpine tar to a file, scp over the private network, untar into the new volume). Or, for research-v2, let it restore from its Litestream replica if one is configured, and copy /data/texts across, since Litestream can't.
  4. Deploy on thinklio-nbg1 against the copied volume. Check it starts with its history: a recent research-v2 job, ormon's last poll, and PocketBase's collection counts against the old copy.
  5. Change DNS and verify as in the first kind.
  6. Keep the old volume untouched for a week, then delete it.

Never run two copies of ormon. Both would hold the management key and could act on the same key.

5. Order

One kind of app at a time, checking each batch before the next.

  1. Pilot: deputy-mcp or asana-mcp, whichever is used least. Proves the method end to end. Drop www.asana.api.thinklio.ai from asana's domains while there.
  2. The other MCP servers: notion-mcp, xero-mcp, cliniko-mcp, seo-service, then research unless it's retired (§3.6).
  3. The bots: pt-bot, then fallbot (DNS outside Cloudflare).
  4. ormon, at a quiet time.
  5. research-v2, when no job is running and RippleBase knows.
  6. pocketbase-fall and cliniko-mirror together, if they move now (§3.7).

Batches 1 to 3 fit in one session. 4 to 6 could too, but each needs its own short window.

6. Rollback

Per app: point DNS back at 178.104.2.63 and start the old app, which is still in Coolify. With 60-second TTLs that takes about a minute. For an app with data, first copy the newer volume back, or accept losing what was written after the move, and say which.

7. After

  1. Add a Coolify health check (/health) to every moved app, so running:unknown becomes healthy or unhealthy.
  2. Update the box table and the runbook in 02 §16.4. Record the decision (§8) in the decision log.
  3. In thinklio-services, registry.yaml keeps the same URLs. Note the host in its notes field if that helps future sessions.
  4. Monitoring: Prometheus on analytics-nbg1 scrapes Thinklio's /v1/metrics only. Consider probing each service's /health too, as ADR-030 suggested.
  5. apps-nbg1: after a month of Sentinel data with only the remaining apps, decide whether it's worth downsizing.

8. Draft decision record (for the decision log once agreed)

Recorded on 31 October 2026 as ADR-041, with Andrew's narrower scope (§0). ADR-031 to ADR-040 are taken by draft records in other proposals. The draft below is kept as written.

ADR-032: Every thinklio-services app, and ormon, runs on thinklio-nbg1

Status: Proposed, 27 October 2026. ADR-031 is the draft model registry on its own branch, so this one takes the next number.

Context: ADR-030 moved four services (Notion, Xero, Cliniko, research) to thinklio-nbg1. The fleet has since grown to eleven apps from thinklio-services, plus the FALL Cliniko mirror's PocketBase, and ormon now guards every OpenRouter key. All of them run on apps-nbg1, a CPX22 shared with other products' backends. thinklio-nbg1, a CPX32 with twice the CPU and memory, runs nothing.

Decision: All apps built from thinklio-services, the pocketbase-fall service and ormon run on thinklio-nbg1. Their public URLs don't change. apps-nbg1 keeps the other products' backends and the ad-hoc apps.

Reasoning: One box for Thinklio's service fleet, with room to grow, separate from unrelated products, as ADR-030 argued for four services. ormon belongs with the fleet whose LLM spend it guards. The move is mostly redeploys and DNS changes, because most of the fleet is stateless. Three resources with data move with a short stop and a copied volume.

9. Who to involve

  • The thinklio-services session owns these services, their Coolify apps and registry.yaml. Execute from there, or brief it.
  • ormon's session (openrouter-monitor) for ormon's move, and for telling its clients.
  • RippleBase's session for research-v2's window. RippleBase is also an ormon client.
  • Andrew for DNS, the Coolify UI, SSH to the boxes, and the go for each batch.