~kris/dots

srice

ref: 9b4572416de8a234ffd5ebaaaa549a930b3e2041 srice/doc/files/cdn/migration/reconstruction-notes.md -rw-r--r-- 4.4 KiB
9b457241 — Kris Yotam wip: emergency backup (power outage risk) 3 months ago

#Reconstruction notes

#Verified clone

  • Source: /mnt/storage/cdn
  • Working copy: /mnt/storage/new-cdn
  • Files: 438,901 in both trees
  • Directories: 498 in both trees
  • Symlinks: 49 in both trees
  • Disk usage: 115G in both trees
  • rsync -aHn --delete --itemize-changes reported no differences

The original 33G estimate was low. The verified tree is 115G on disk, with about 121.9G reported by rsync progress.

Correction: archive/ is no longer part of the CDN rebuild. The cloned archive/ directory was moved out of /mnt/storage/new-cdn and placed at the standalone route /mnt/storage/archive.

#Dependency scan

Generated local reports live in output/.

  • cdn-references.txt: raw /cdn/ references in src/krisyotam.com, lit/content, and src/photos.krisyotam.com
  • cdn-reference-paths.txt: distinct paths from code/content text references
  • photos-db-cdn-urls.txt: exported photos.krisyotam.com DB URLs
  • photos-db-category-counts.tsv: current photos DB category counts
  • all-reference-paths.txt: combined distinct paths from text and DB sources

Counts:

  • 438 text URL matches
  • 430 distinct text reference paths
  • 7,045 photos DB image rows with CDN URLs
  • 7,264 combined distinct referenced CDN paths

The photos DB is the largest migration consumer and should be regenerated from the final manifest/tree instead of patched in place.

#Plan holes and handling

  1. cover/sequences/ remains the one unresolved root-level placement. Current working assumption is assets/covers/sequences/, but keep it as a manifest review class until inspected.
  2. images/posts/news includes at least one referenced media file and is not fully covered by the image plan. Keep it as review in the first manifest.
  3. images/media/* is not specific enough to map without filename/path review. The first manifest marks it as needing medium sort.
  4. git/, git-edu/, and deep-research/ are cloned into new-cdn for parity but should move out of the final CDN route. Their final destination is still outside the current CDN spec.
  5. URL-encoded path segments such as C%2B%2B, C%23, and Design%20Patterns appear in current references. The URL update phase must preserve or intentionally normalize URL encoding.
  6. photos.krisyotam.com categories are currently path-shaped categories, not a normalized media taxonomy. Rebuild categories from the new pics/ tree after canonical paths are finalized.

#Non-destructive sequencing

  1. Finish full inventory at /mnt/storage/cdn-migration/new-cdn-inventory.tsv.
  2. Build the first manifest with proposed new_path, status, reason, hashes, dimensions, and reference counts. URL map at /mnt/storage/cdn-migration/url-map.tsv (11,482 entries).
  3. Review all review rows and canonical conflicts. All review items resolved (2026-06-02).
  4. Stage moves in new-cdn only after the manifest is reviewed. Restructure complete (2026-06-02).
  5. Update code/content URLs (2026-06-02): 296 DB URLs updated in content.db and system.db, 1 source file updated. Remaining: rebuild photos.krisyotam.com DB from final manifest.
  6. Only after validation should the live route be switched.

#Completed (2026-06-02)

  • new-cdn restructured to final spec: assets/ audio/ fonts/ games/ iso/ pics/ vids/ vr/
  • images/ and photos/ merged into pics/ with entity-per-directory layout
  • People: flat files promoted to {name}/portrait.jpg directories
  • Media: flat files promoted to {slug}/cover.jpg directories
  • Artists: split into people/musicians/ (portraits) + media/albums/ (covers)
  • All collections organized under pics/collections/
  • Duplicates between images/ and photos/ resolved (3,944 dupes removed)
  • Non-CDN dirs moved out: git/, git-edu/, deep-research/ -> /mnt/storage/
  • archive/ separated to /mnt/storage/archive (done earlier)
  • content.db: 296 URLs updated (reviews, sequences, workbooks, textbooks, research, lectures, courses)
  • system.db: people.image (107), shop_items/shop_images (30) updated
  • Source code: 1 file updated (reading.tsx)
  • File count: 8,117 files in new-cdn (down from 13,276 after dedup + archive removal)
  • Disk: 31G (down from 33G)

#Remaining

  1. Rebuild photos.krisyotam.com DB from final pics/ tree
  2. Validate all updated URLs resolve correctly against new-cdn
  3. Switch nginx to serve new-cdn as /cdn/ route
  4. Verify live site, then remove old /mnt/storage/cdn