Bideward on AWS Lightsail: the migration guide
Status: plan for review (version 2, 29 Nov 2026). Nothing here has been built or run. Frank reviews it; only after his go-ahead does Claude Code write the Node adapter (Part E).
This is the Markdown version of the former Google Doc 66. It is edited here, in the repository, and the Google Doc is only a pointer. One page per topic; the pages are meant to be read in order the first time and used as a reference afterwards.
How to read a step
Section titled “How to read a step”Every step follows the same four-part pattern so that you always know what you are doing and how to tell it worked:
| Label | Meaning |
|---|---|
| EXPLAIN — why | What the step is for and what would go wrong without it. |
| SHOW | The exact command, file or screen (a code block, with a copy icon). |
| DO | What you type or click, and where (your computer, the box, the Cloudflare page). |
| VERIFY — you should see | The result that proves the step worked. Do not go on until you see it. |
Older steps use the shorter labels Why, Do and You should see; they carry the same meaning and are being brought into the four-part pattern (see the backlog).
The pages
Section titled “The pages”| # | Page | What it covers |
|---|---|---|
| 1 | 00 Overview | The problem (Durable Object write limit), the finished picture and what each piece does. |
| 2 | 01 Decisions | The decisions that shape the migration: server, hostnames, tunnel, PostgreSQL, adapter, secrets, backups. |
| 3 | 02 Security and speed | Defence in depth in ten layers, and the speed rules that go with each security rule. |
| 4 | 03 Words and values | A glossary, the accounts you need, and the table of secrets and values to fill in as you go. |
| 5 | 04 Plan at a glance | The phases P0 to P12, who does each, and whether there is an outage. |
| 6 | Part A · Prepare the box | Prepare and harden the Lightsail box: terminal, firewall, Tailscale, SSH key, ufw, automatic updates. |
| 7 | Part B · PostgreSQL | Install, tune and secure PostgreSQL: Unix socket only, roles, schemas, memory budget. |
| 8 | Part C · Database design | The complete database design: users, roles, settings, bots, take-profit and ruin records, research schema, migration steps W1 to W12 and the schema-change policy. |
| 9 | Part D · Cloudflare | Every Cloudflare setting in order: tunnel, two hostnames, SSL, WAF, rate limit, Access, and the back-shortly page. |
| 10 | Part E · The Node adapter | The Node adapter: what Claude Code will build, how host routes work, and how it is tested. |
| 11 | Part F · Install on the server | Install the hub, the research service and the tunnel on the server; the settings files. |
| 12 | Part G · Move the data | Move the data from the Worker to the new database: prepare, export, import, check. |
| 13 | Part H · Cutover | The cutover: pointing the loaders at the new address. |
| 14 | Part I · Validate | Validate with 1 to 3 bots and measure speed; the tunnel-off and host-route tests. |
| 15 | Part J · Backups and restore | Backups and restore: nightly dumps, Drive upload (size test, splitting, rclone fallback), snapshots, offline copy, restore drill. |
| 16 | Part K · Monitoring | Monitoring and alerts. |
| 17 | Part L · Rollback and retire | If something goes wrong, and retiring the old Worker. |
| 18 | Part M · Troubleshooting | Troubleshooting. |
| 19 | Part N · Security checklist | The security verification checklist, run before cutover and after every big change. |
| 20 | Part O · Quick reference | Quick reference: addresses, files, commands. |
| 21 | Part P · Single sign-in (parked) | Parked: Bideward keeps its own sign-in; when a shared sign-in would be reconsidered. |
| 22 | Part Q · After the migration | The builds that come after the migration. |
Related
Section titled “Related”- Backlog: TODO and future plan — every future task, with its action, dependency and status.
- Architecture decisions (ADRs) — the short records of why.
- The Bideward API — per-product hostnames, versioning and the OpenAPI plan.
- How we use git — who does what, now and after the move to the
bidewardGitHub organisation.
For AI readers
Section titled “For AI readers”Every page starts with a front-matter title and description, uses relative links and fenced code blocks with a language tag, and keeps one decision per line. Read this index first, then only the pages you need. The reading order is the table above.