@ninkch/dsh-infinite-canvas 0.17.18 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,70 @@
1
+ # Migrating to the 0.18 storage engine
2
+
3
+ Version 0.18.0 moves all Infinite Canvas data (project documents, the asset library,
4
+ and media files) into **one self-contained data directory**. This guide covers
5
+ upgrading an existing deployment and moving data to a new machine.
6
+
7
+ ## What changed
8
+
9
+ | Before (≤ 0.17.x) | After (0.18+) |
10
+ |---|---|
11
+ | Asset metadata in **each browser's IndexedDB** | **`<dataRoot>/canvas.db`** (SQLite, WAL) — one source of truth for every browser |
12
+ | Project documents in `~/.dsh/infinite-canvas/projects/*.json` + a mirror in the data directory | Stored in `canvas.db`; the old files are frozen and no longer written |
13
+ | Media in `<dataRoot>/projects/<project>/<kind>/…` + metadata mirror `assets.json` | New uploads go to `<dataRoot>/objects/<sha2>/<sha256>` (content-addressed, deduplicated); legacy files stay where they are and keep working |
14
+ | Copying the data directory was not enough to migrate | The data directory **is** the complete data package — copy it, point the data root at it, done |
15
+
16
+ ## Upgrade the production machine
17
+
18
+ 1. **Update the plugin to 0.18.0** (in DSH: check updates on the Infinite Canvas
19
+ toolbar, or `updateInstall`). Requires DSH host on Node ≥ 22.5 — the bundled
20
+ Node 24 satisfies this. Restart the Harness when prompted (index.js changed).
21
+ 2. **Open the canvas once.** On first data-root access the plugin creates
22
+ `canvas.db` and auto-imports everything it finds:
23
+ - project documents from `~/.dsh/infinite-canvas/projects/*.json` **and** the
24
+ data-directory mirrors (newer `updatedAt` wins),
25
+ - asset metadata from the legacy `assets.json` indexes.
26
+ Legacy media files are **not moved** — the database keeps pointing at them, so
27
+ the migration cannot lose media.
28
+ 3. **Open the canvas once in each old browser** that was used before the upgrade
29
+ (e.g. the desktop app webview). Blobs that were still only in that browser's
30
+ IndexedDB are uploaded to the server automatically, then removed locally.
31
+ 4. Verify: the asset panel shows your library, previews load, `@Name@` mentions
32
+ resolve. Other machines/browsers now see the same library immediately.
33
+
34
+ ## Move everything to a new machine
35
+
36
+ 1. On the old machine, **quit the Harness** (a clean exit folds the WAL journal
37
+ back into `canvas.db`). If you must copy a running directory, copy all
38
+ `canvas.db*` files (`canvas.db`, `canvas.db-wal`, `canvas.db-shm`).
39
+ 2. Copy the **entire data directory** to the new machine (e.g. `D:\canvas-data`),
40
+ including `objects/`.
41
+ 3. On the new machine, install the plugin (0.18+), open Infinite Canvas →
42
+ Settings → data root → point it at the copied directory. The database mounts
43
+ as-is; if the directory is an old ≤ 0.17 layout (no `canvas.db`), the one-shot
44
+ migration runs automatically.
45
+ 4. Open the canvas — all projects, storyboards, the bible and the full asset
46
+ library are there. No import button needed.
47
+
48
+ ## Remote access (tunnel / another PC)
49
+
50
+ Nothing special: with the data root configured on the host machine, any browser
51
+ that can reach the Harness web UI gets the same projects and assets. Asset
52
+ content is streamed by the host (`/api/object`, `/api/file`), and previews work
53
+ remotely. Note that these routes follow your Harness authentication — put your
54
+ tunnel behind access control if the content matters.
55
+
56
+ ## Rollback
57
+
58
+ Downgrade the plugin to 0.17.x and it reads the legacy stores again. Everything
59
+ that existed before the upgrade is still in its original location (old project
60
+ JSON files, `assets.json`, media files) — 0.18 freezes them rather than deleting.
61
+ Data created **after** upgrading lives only in `canvas.db`/`objects/` and will
62
+ not appear under 0.17.x, so treat rollback as a one-way door for new data.
63
+
64
+ ## Backup
65
+
66
+ With the Harness stopped, backing up the data directory is a plain file copy:
67
+ `canvas.db` (plus `-wal`/`-shm` if present) and `objects/`. To verify integrity
68
+ after restoring, open the canvas and spot-check a few assets; the database can be
69
+ rebuilt from a frozen ≤ 0.17 layout plus browser-side uploads if ever needed
70
+ (`objectsGc` reclaims orphaned objects).