Move from v0: migration dry run #12

Open
opened 2026-10-13 15:01:17 +00:00 by kayg · 3 comments
Owner

Move from v0 (ADR 0034), dry run first.

  • Inventory kayg's v0 Home on the calternal-cloud VM (read-only).
  • Idempotent migration: rename daily notes, convert links, times to +05:30, strip tasks query blocks, recreate security state, rebuild derived data. Report everything it changed.
  • Re-copyable into next.calternal.cloud. Never touches v0 data in place.
Move from v0 (ADR 0034), dry run first. - Inventory kayg's v0 Home on the calternal-cloud VM (read-only). - Idempotent migration: rename daily notes, convert links, times to +05:30, strip tasks query blocks, recreate security state, rebuild derived data. Report everything it changed. - Re-copyable into next.calternal.cloud. Never touches v0 data in place.
Author
Owner

v0 data inventory (read-only, 2026-10-13)

Nothing on the VM was changed. Counts only, no content.

Where things live

  • User files: /mnt/hdd/calternal/userdata/users/<uuid>/ on the HDD (one user). Every user file is hardlinked into userdata/.cas (433 MB unique).
  • System: /srv/calternal/data/.system/ on the SSD: index.sqlite 889 MB (192 tables), Tantivy + CLIP indexes, models 172 MB, web-assets 166 MB, backups/ 5.4 GB (7 index copies). Plus 4 pre-ship backups of 6.6 GB each in /srv/calternal/.
Area Files Size Notes
Notes 706 .md, flat 1.1 MB + an empty Notes/Journal/ folder
Documents 629 (469 pdf, 140 docx, 18 xls/xlsx, 1 zip, 1 webm) 212 MB 2 subfolders
Photos 23 174 MB some iPhone files have no extension
Money 67 .md (63 monthly YYYY-MM.md, budgets, accounts) 6.6 MB, ~79k lines the 16,299 register rows in the DB are derived from these
Calendar 0 empty
.Trash 47 42 MB includes money-import temp files
.calternal 1,589 7.4 MB versions/ 1,497 snapshots, history/ 63, recovery/ 13, tag-rewrites/ 15, settings.json

Notes

  • Naming: none are Title.md. 665 are daily notes YYYYMMDD-dailynote.md (665 unique dates, 2022-11-20 → 2026-10-12, no duplicates). 41 are YYYYMMDD-slug-hash.md.
  • 13 …-ghost-application-conflict-<hash>.md files: conflict copies left by v0 bugs.
  • Encoding is clean: 0 BOM, 0 CRLF, 0 non-UTF-8, 0 NFD names, 0 case collisions, no long names. Every file has frontmatter. 142 have an H1.
  • Frontmatter keys (files): last edited 706, calternal-id 706, date 705, tags 595 (588 YAML block lists, 7 inline), title 555, next 497, previous 492, type 273 (all a [Journal] list), uid 273, aliases 145 (mostly empty), Previous Day/Next Day 79, Last Year 79, slug 26, calternal-events 14, created 11, status 8, completed 2, scheduled 1, calternal-reminders 1, ios 1, excalidraw-plugin 1, kind 1.
  • Time formats are mixed: date comes in 4 shapes (YYYY-MM-DD HH:MM:SS, YYYY-MM-DD HH:MM, YYYY-MM-DD Thu HH:MM with a weekday, …) and none has an offset. last edited is empty in about 200 files.
  • Block ids: ^id sits on 7,821 of 13,315 non-empty lines (59%) across 550 files. Only 15 links in files use a #anchor.
  • Links: 2,522 local markdown links. About 810 resolve as written, 208 only by file name, and about 1,500 point to paths that don't exist (old vault layout: inbox/, notes/, old/, views/, projects/, ../../, %20-encoded bare titles, ./2026-10-13 with no .md). There are 1,066 ./ links, 416 ../ links, 204 [[wikilinks]] (1 aliased, 1 ![[embed]]), 42 http links, and a few custom URL schemes.
  • Frontmatter navigation links: previous/next/Previous Day/Next Day/Last Year hold about 1,500 links, in 3 formats.
  • Daily logs: 3,168 log lines in 279 files. 516 files have a ## … Log heading, so many headings are empty.
  • ```tasks query blocks: 417 in 255 files.
  • Other content: 8,333 #tags, 186 task lines, 129 callouts, 68 --- dividers in bodies, 21 tables, ~150 code fences, 21 images, 4 raw HTML tags.

State that lives only in the DB

  • Auth: 1 user, 1 passkey, 11 app passwords, 4 sessions, recovery key, setup token, 19 security events.
  • Mail: 1 account with 17 folders and 13,713 messages indexed. Bodies stay on the remote IMAP server. The account credentials live in integration_accounts.
  • Other: 2 block reminders, 60 task items (3 attachments), 20 notifications, 21 photo groups, search frecency, 85 analytics days, 719 app changes.
  • semantic-search.sqlite is empty.

What ADR 0034 doesn't cover yet

  1. The rename to Title.md needs a title source: title: (555), then the H1 (142), then a slug fallback. 665 daily notes become YYYY-MM-DD.md.
  2. The 13 conflict copies need review (diff against the original, keep or merge, report). Never migrate them blindly.
  3. 59% of lines carry ^ids. Strip ids that nothing links to (in files or the DB), with a report, or note files get noisy.
  4. About 1,500 dead links: resolve by file name, by title and by %20-decoding, then report the rest. Never invent targets.
  5. Frontmatter navigation keys (previous/next/Previous Day/Next Day/Last Year): drop them, since they're derivable, or keep them as-is. This needs a decision.
  6. Time parsing has to cope with 4+ shapes including weekday names, and with ~200 empty last edited. Fill the gaps from file mtime or history.
  7. Unknown keys (uid, type, slug, aliases, status, calternal-events, …) are kept verbatim by default.
  8. Passkey: the credential's public key can be carried over if rpId stays calternal.cloud, so kayg wouldn't need to re-enrol. App passwords should be rotated.
  9. Mail account credentials + IMAP state, Money ledgers, Documents, Photos (extension-less files) and Trash all need a policy, even if those areas come later. Copy them untouched now.
  10. .calternal/versions (1,497 snapshots): import as history, or archive read-only.
  11. The .cas hardlink store: re-ingest into our own store, don't copy its layout.
  12. The 5.4 GB of index backups and 26 GB of pre-ship backups can be cleaned up after cutover, with kayg's OK.
## v0 data inventory (read-only, 2026-10-13) Nothing on the VM was changed. Counts only, no content. ### Where things live - User files: `/mnt/hdd/calternal/userdata/users/<uuid>/` on the **HDD** (one user). Every user file is hardlinked into `userdata/.cas` (433 MB unique). - System: `/srv/calternal/data/.system/` on the SSD: `index.sqlite` 889 MB (192 tables), Tantivy + CLIP indexes, models 172 MB, web-assets 166 MB, **`backups/` 5.4 GB** (7 index copies). Plus 4 pre-ship backups of 6.6 GB each in `/srv/calternal/`. | Area | Files | Size | Notes | |---|---|---|---| | Notes | 706 `.md`, flat | 1.1 MB | + an empty `Notes/Journal/` folder | | Documents | 629 (469 pdf, 140 docx, 18 xls/xlsx, 1 zip, 1 webm) | 212 MB | 2 subfolders | | Photos | 23 | 174 MB | some iPhone files have **no extension** | | Money | 67 `.md` (63 monthly `YYYY-MM.md`, budgets, accounts) | 6.6 MB, ~79k lines | the 16,299 register rows in the DB are derived from these | | Calendar | 0 | | empty | | .Trash | 47 | 42 MB | includes money-import temp files | | .calternal | 1,589 | 7.4 MB | versions/ 1,497 snapshots, history/ 63, recovery/ 13, tag-rewrites/ 15, settings.json | ### Notes - **Naming:** none are `Title.md`. 665 are daily notes `YYYYMMDD-dailynote.md` (665 unique dates, 2022-11-20 → 2026-10-12, no duplicates). 41 are `YYYYMMDD-slug-hash.md`. - **13 `…-ghost-application-conflict-<hash>.md` files**: conflict copies left by v0 bugs. - Encoding is clean: 0 BOM, 0 CRLF, 0 non-UTF-8, 0 NFD names, 0 case collisions, no long names. Every file has frontmatter. 142 have an H1. - **Frontmatter keys** (files): `last edited` 706, `calternal-id` 706, `date` 705, `tags` 595 (588 YAML block lists, 7 inline), `title` 555, `next` 497, `previous` 492, `type` 273 (all a `[Journal]` list), `uid` 273, `aliases` 145 (mostly empty), `Previous Day`/`Next Day` 79, `Last Year` 79, `slug` 26, `calternal-events` 14, `created` 11, `status` 8, `completed` 2, `scheduled` 1, `calternal-reminders` 1, `ios` 1, `excalidraw-plugin` 1, `kind` 1. - **Time formats are mixed:** `date` comes in 4 shapes (`YYYY-MM-DD HH:MM:SS`, `YYYY-MM-DD HH:MM`, `YYYY-MM-DD Thu HH:MM` with a weekday, …) and none has an offset. `last edited` is **empty in about 200 files**. - **Block ids:** `^id` sits on **7,821 of 13,315 non-empty lines (59%)** across 550 files. Only 15 links in files use a `#anchor`. - **Links:** 2,522 local markdown links. About 810 resolve as written, 208 only by file name, and about 1,500 point to paths that don't exist (old vault layout: `inbox/`, `notes/`, `old/`, `views/`, `projects/`, `../../`, `%20`-encoded bare titles, `./2026-10-13` with no `.md`). There are 1,066 `./` links, 416 `../` links, 204 `[[wikilinks]]` (1 aliased, 1 `![[embed]]`), 42 http links, and a few custom URL schemes. - **Frontmatter navigation links:** `previous`/`next`/`Previous Day`/`Next Day`/`Last Year` hold about 1,500 links, in 3 formats. - **Daily logs:** 3,168 log lines in 279 files. 516 files have a `## … Log` heading, so many headings are empty. - **```tasks query blocks: 417 in 255 files.** - Other content: 8,333 `#tags`, 186 task lines, 129 callouts, 68 `---` dividers in bodies, 21 tables, ~150 code fences, 21 images, 4 raw HTML tags. ### State that lives only in the DB - **Auth:** 1 user, 1 passkey, 11 app passwords, 4 sessions, recovery key, setup token, 19 security events. - **Mail:** 1 account with 17 folders and 13,713 messages indexed. Bodies stay on the remote IMAP server. The account credentials live in `integration_accounts`. - **Other:** 2 block reminders, 60 task items (3 attachments), 20 notifications, 21 photo groups, search frecency, 85 analytics days, 719 app changes. - `semantic-search.sqlite` is empty. ### What ADR 0034 doesn't cover yet 1. **The rename to `Title.md` needs a title source:** `title:` (555), then the H1 (142), then a slug fallback. 665 daily notes become `YYYY-MM-DD.md`. 2. **The 13 conflict copies** need review (diff against the original, keep or merge, report). Never migrate them blindly. 3. **59% of lines carry `^id`s.** Strip ids that nothing links to (in files or the DB), with a report, or note files get noisy. 4. **About 1,500 dead links:** resolve by file name, by title and by `%20`-decoding, then report the rest. Never invent targets. 5. **Frontmatter navigation keys** (`previous`/`next`/`Previous Day`/`Next Day`/`Last Year`): drop them, since they're derivable, or keep them as-is. This needs a decision. 6. **Time parsing** has to cope with 4+ shapes including weekday names, and with ~200 empty `last edited`. Fill the gaps from file mtime or history. 7. **Unknown keys** (`uid`, `type`, `slug`, `aliases`, `status`, `calternal-events`, …) are kept verbatim by default. 8. **Passkey:** the credential's public key can be carried over if rpId stays `calternal.cloud`, so kayg wouldn't need to re-enrol. App passwords should be rotated. 9. **Mail account credentials + IMAP state**, Money ledgers, Documents, Photos (extension-less files) and Trash all need a policy, even if those areas come later. Copy them untouched now. 10. **`.calternal/versions` (1,497 snapshots):** import as history, or archive read-only. 11. **The `.cas` hardlink store:** re-ingest into our own store, don't copy its layout. 12. **The 5.4 GB of index backups and 26 GB of pre-ship backups** can be cleaned up after cutover, with kayg's OK.
Author
Owner

Decisions from kayg (2026-10-13) for the migration:

  • M1 daily notes become YYYY-MM-DD.md, other notes <Title>.md (title from title:, then the H1, then the old slug).
  • M2 broken links are repaired by matching titles; the rest are listed in the report, with the link text kept.
  • M3 previous / next / Previous Day / Next Day / Last Year frontmatter is dropped.
  • M4 unreferenced ^ids are stripped; the 15 referenced ones stay.
  • M5 keep aliases; date: becomes ISO+05:30; an empty last edited: is filled from file times; drop uid, type, slug, calternal-events, calternal-reminders.
  • M6 the 13 ghost-application-conflict copies are deleted (not migrated).
  • M7 tasks query blocks are stripped, and the report lists the notes that held them.
  • M8 only notes and attachments move. Mail, money, tasks, reminders, photo groups and old snapshots stay archived read-only in v0.
  • M9 no passkey carry-over: kayg enrolls a new passkey. The v0 app passwords are retired.
**Decisions from kayg (2026-10-13)** for the migration: - **M1** daily notes become `YYYY-MM-DD.md`, other notes `<Title>.md` (title from `title:`, then the H1, then the old slug). - **M2** broken links are repaired by matching titles; the rest are listed in the report, with the link text kept. - **M3** `previous` / `next` / `Previous Day` / `Next Day` / `Last Year` frontmatter is dropped. - **M4** unreferenced `^id`s are stripped; the 15 referenced ones stay. - **M5** keep `aliases`; `date:` becomes ISO+05:30; an empty `last edited:` is filled from file times; drop `uid`, `type`, `slug`, `calternal-events`, `calternal-reminders`. - **M6** the 13 `ghost-application-conflict` copies are **deleted** (not migrated). - **M7** tasks query blocks are stripped, and the report lists the notes that held them. - **M8** only notes and attachments move. Mail, money, tasks, reminders, photo groups and old snapshots stay archived read-only in v0. - **M9** no passkey carry-over: kayg enrolls a new passkey. The v0 app passwords are retired.
Author
Owner

Migration run on staging (2026-10-13). Counts only.

  • Tool: PR #48 (calternal migrate-v0).
  • Input: a read-only copy of kayg's v0 user folder, at /mnt/hdd/calternal-migrate/v0-copy on calternal-staging. Prod was only read.
  • Output: /mnt/hdd/calternal-migrate/home.
  • The full report, which names notes, stays on the server (report.json).
mode real run
notes found 706 (665 daily, 28 other)
conflict copies deleted (M6) 13
files in subfolders skipped 0
notes written / unchanged 693 / 0
names given a number to stay unique 3
links 1533 total: 26 to notes (26 repaired), 5 to attachments, 122 external, 1380 unresolved (kept as written)
wikilinks converted 204 (203 to notes that don't exist yet)
block ids stripped / kept (M4) 7821 / 0
tasks query blocks stripped (M7) 300 in 216 notes
generated daily headings / titles removed 113 / 205
date: converted to +05:30 / unreadable (fallback) / added 691 / 1 / 1
last edited: filled from file time 201
keys dropped (M3, M5) Last Year 79, Next Day 79, Previous Day 79, calternal-events 14, calternal-reminders 1, next 497, previous 492, slug 13, type 273, uid 273
attachments copied 4 (16.2 MB)

Checks:

  • A second run changed nothing (0 written, 693 unchanged).
  • Debian and Nix builds produced byte-identical output (697 files).
  • A real calternal serve adopted all 693 notes, with days as day-YYYY-MM-DD, and opening them wrote nothing.

About the 1,380 unresolved links: they point at the old vault (../../public/notes/…, old/notes/…, inbox/…) or at notes that aren't in v0's Notes folder. They stay as written.

Not installed into next yet. kayg's account on next must exist first. Then the Home is copied into /srv/calternal-next/data/users/<uuid>/ with the service stopped. The steps are in crates/migrate-v0/README.md.

**Migration run on staging (2026-10-13). Counts only.** - **Tool:** PR #48 (`calternal migrate-v0`). - **Input:** a read-only copy of kayg's v0 user folder, at `/mnt/hdd/calternal-migrate/v0-copy` on calternal-staging. Prod was only read. - **Output:** `/mnt/hdd/calternal-migrate/home`. - The full report, which names notes, stays on the server (`report.json`). | | | |---|---| | mode | real run | | notes found | 706 (665 daily, 28 other) | | conflict copies deleted (M6) | 13 | | files in subfolders skipped | 0 | | notes written / unchanged | 693 / 0 | | names given a number to stay unique | 3 | | links | 1533 total: 26 to notes (26 repaired), 5 to attachments, 122 external, 1380 unresolved (kept as written) | | wikilinks converted | 204 (203 to notes that don't exist yet) | | block ids stripped / kept (M4) | 7821 / 0 | | tasks query blocks stripped (M7) | 300 in 216 notes | | generated daily headings / titles removed | 113 / 205 | | `date:` converted to +05:30 / unreadable (fallback) / added | 691 / 1 / 1 | | `last edited:` filled from file time | 201 | | keys dropped (M3, M5) | `Last Year` 79, `Next Day` 79, `Previous Day` 79, `calternal-events` 14, `calternal-reminders` 1, `next` 497, `previous` 492, `slug` 13, `type` 273, `uid` 273 | | attachments copied | 4 (16.2 MB) | **Checks:** - A second run changed nothing (0 written, 693 unchanged). - Debian and Nix builds produced byte-identical output (697 files). - A real `calternal serve` adopted all 693 notes, with days as `day-YYYY-MM-DD`, and opening them wrote nothing. **About the 1,380 unresolved links:** they point at the old vault (`../../public/notes/…`, `old/notes/…`, `inbox/…`) or at notes that aren't in v0's Notes folder. They stay as written. **Not installed into next yet.** kayg's account on next must exist first. Then the Home is copied into `/srv/calternal-next/data/users/<uuid>/` with the service stopped. The steps are in `crates/migrate-v0/README.md`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal#12
No description provided.