## Parent Epic #314 ## Goal Migrate all data from the personal D1 database to the SCCN D1 database. ## Tables to Migrate - `users` (accounts, hashed passwords, roles, status) - `datasets` (metadata, sync status, DOI info) - `dataset_versions` (version history) - `dataset_collaborators` (access control) - `publication_requests` (publication workflow state) - `email_verification_tokens` - Any other tables from migrations 0001-0014+ ## Tasks - [ ] Export all data from personal D1 (`wrangler d1 execute --command "SELECT * FROM ..."`) - [ ] Verify schema matches on SCCN D1 (migrations already applied in Phase 3) - [ ] Import data into SCCN D1 - [ ] Verify row counts match - [ ] Verify encrypted fields are readable (depends on identical `ENCRYPTION_KEY`) - [ ] Re-index Vectorize with dataset data from new D1 - [ ] Validate a sample of records end-to-end ## Depends On - #324 (Phase 3: D1 created with schema) - #325 (Phase 4: ENCRYPTION_KEY set) ## Notes - D1 export/import may need custom scripting (no native D1 dump tool) - Consider using `wrangler d1 execute` with INSERT statements - Encrypted per-user AWS credentials must remain byte-identical - Vectorize index needs full rebuild after data migration
Activity
neuromechanist commentedon Mar 22, 2026
Status: Done
All data migrated from personal D1 to SCCN D1. Row counts verified:
Verified:
Migration method: Cloudflare D1 REST API (direct JSON export/import). Used parameterized queries for rows with special characters.
neuromechanist commentedon Apr 18, 2026
Done (pre-existing). SCCN D1 already holds full production data: 198 datasets, 14 users, 36 versions (dump/restore landed ~Apr 14). Safety audit 2026-04-18: 27 nm* + 21 on* + 0 xx* user-managed datasets match exactly on both sides. Only drift is 1 ds* catalog row (ds006963) which self-heals via catalog-sync. Schema aligned (0019_user_description tracking fixed today).