Migrate Skill
Universal migration from any wiki, note tool, or brain system into GBrain.
Contract
- Source data is never modified or deleted; migration is additive only.
- Every migrated page is verified round-trip: written to gbrain, read back, spot-checked.
- Cross-references from the source system (wikilinks, block refs, tags) are converted to gbrain equivalents.
- Migration is tested on a sample (5-10 files) before bulk execution.
- Post-migration health check confirms page count, link integrity, and embedding coverage.
Supported Sources
| Source |
Format |
Strategy |
| Obsidian |
Markdown + [[wikilinks]] |
Direct import, convert wikilinks to gbrain links |
| Notion |
Exported markdown or CSV |
Parse Notion's export structure |
| Logseq |
Markdown with ((block refs)) |
Convert block refs to page links |
| Plain markdown |
Any .md directory |
Import directory into gbrain directly |
| CSV |
Tabular data |
Map columns to frontmatter fields |
| JSON |
Structured data |
Map keys to page fields |
| Roam |
JSON export |
Convert block structure to pages |
Phases
- Assess the source. What format? How many files? What structure?
- Plan the mapping. How do source fields map to gbrain fields (type, title, tags, compiled_truth, timeline)?
- Test with a sample. Import 5-10 files, verify by reading them back from gbrain and exporting.
- Bulk import. Import the full directory into gbrain.
- Verify. Check gbrain health and statistics, spot-check pages.
- Build links. Extract cross-references from content and create typed links in gbrain.
Obsidian Migration
Import the vault directory into gbrain (Obsidian vaults are markdown directories)
Wire the graph with native wikilink support (v0.12.1+):
gbrain extract links --source db --dry-run | head -20 # preview
gbrain extract links --source db # commit
extract links natively parses [[relative/path]] and [[relative/path|Display Text]]
alongside standard [text](page.md) markdown syntax. Ancestor-search resolution handles
wiki KBs where authors omit one or more leading ../ prefixes. The .md suffix is
inferred automatically for wikilinks.
Obsidian-specific:
- Tags (
#tag) become gbrain tags
- Frontmatter properties map to gbrain frontmatter
- Attachments (images, PDFs) are noted but handled separately via file storage
Notion Migration
- Export from Notion: Settings > Export > Markdown & CSV
- Notion exports nested directories with UUIDs in filenames
- Strip UUIDs from filenames for clean slugs
- Map Notion's database properties to frontmatter
- Import the cleaned directory into gbrain
CSV Migration
For tabular data (e.g., CRM exports, contact lists):
- For each row in the CSV, create a page with column values as frontmatter
- Use a designated column as the slug (e.g., name)
- Use another column as compiled_truth (e.g., notes)
- Store each page in gbrain
Verification
After any migration:
- Check gbrain statistics to verify page count matches source
- Check gbrain health for orphans and missing embeddings
- Export pages from gbrain for round-trip verification
- Spot-check 5-10 pages by reading them from gbrain
- Test search: search gbrain for "someone you know is in the data"
Anti-Patterns
- Bulk import without sample test. Never import the full dataset before verifying with 5-10 files. The cost of cleaning up hundreds of bad pages is enormous.
- Destroying source data. Migration is additive. Never modify, move, or delete the source files.
- Ignoring cross-references. Wikilinks, block refs, and tags from the source system must be converted to gbrain equivalents. Dropping them loses the knowledge graph.
- Skipping verification. A migration without post-import health check, page count comparison, and spot-check reads is incomplete.
Output Format
MIGRATION REPORT -- [source] -> GBrain
=======================================
Source: [format] ([file count] files, [size])
Mapping: [field mapping summary]
Sample Test (N files):
- Imported: N/N
- Round-trip verified: N/N
- Cross-refs converted: N
Bulk Import:
- Total imported: N
- Skipped (duplicates/errors): N
- Links created: N
- Tags migrated: N
Verification:
- Page count match: [yes/no]
- Health check: [pass/fail]
- Search test: [query] -> [result count] hits
Tools Used
- Store/update pages in gbrain (put_page)
- Read pages from gbrain (get_page)
- Link entities in gbrain (add_link)
- Tag pages in gbrain (add_tag)
- Get gbrain statistics (get_stats)
- Check gbrain health (get_health)
- Search gbrain (query)
1---2name: migrate3description: Universal migration from Obsidian, Notion, Logseq, markdown, CSV, JSON, Roam4---5
6# Migrate Skill
7
8Universal migration from any wiki, note tool, or brain system into GBrain.
9
10## Contract
11
12- Source data is never modified or deleted; migration is additive only.
13- Every migrated page is verified round-trip: written to gbrain, read back, spot-checked.
14- Cross-references from the source system (wikilinks, block refs, tags) are converted to gbrain equivalents.
15- Migration is tested on a sample (5-10 files) before bulk execution.
16- Post-migration health check confirms page count, link integrity, and embedding coverage.
17
18## Supported Sources
19
20| Source | Format | Strategy |
21|--------|--------|----------|
22| Obsidian | Markdown + `[[wikilinks]]` | Direct import, convert wikilinks to gbrain links |
23| Notion | Exported markdown or CSV | Parse Notion's export structure |
24| Logseq | Markdown with `((block refs))` | Convert block refs to page links |
25| Plain markdown | Any .md directory | Import directory into gbrain directly |
26| CSV | Tabular data | Map columns to frontmatter fields |
27| JSON | Structured data | Map keys to page fields |
28| Roam | JSON export | Convert block structure to pages |
29
30## Phases
31
321. **Assess the source.** What format? How many files? What structure?
332. **Plan the mapping.** How do source fields map to gbrain fields (type, title, tags, compiled_truth, timeline)?
343. **Test with a sample.** Import 5-10 files, verify by reading them back from gbrain and exporting.
354. **Bulk import.** Import the full directory into gbrain.
365. **Verify.** Check gbrain health and statistics, spot-check pages.
376. **Build links.** Extract cross-references from content and create typed links in gbrain.
38
39## Obsidian Migration
40
411. Import the vault directory into gbrain (Obsidian vaults are markdown directories)
422. Wire the graph with native wikilink support (v0.12.1+):
43
44 ```bash
45 gbrain extract links --source db --dry-run | head -20 # preview
46 gbrain extract links --source db # commit
47 ```
48
49 `extract links` natively parses `[[relative/path]]` and `[[relative/path|Display Text]]`
50 alongside standard `[text](page.md)` markdown syntax. Ancestor-search resolution handles
51 wiki KBs where authors omit one or more leading `../` prefixes. The `.md` suffix is
52 inferred automatically for wikilinks.
53
54Obsidian-specific:
55- Tags (`#tag`) become gbrain tags
56- Frontmatter properties map to gbrain frontmatter
57- Attachments (images, PDFs) are noted but handled separately via file storage
58
59## Notion Migration
60
611. Export from Notion: Settings > Export > Markdown & CSV
622. Notion exports nested directories with UUIDs in filenames
633. Strip UUIDs from filenames for clean slugs
644. Map Notion's database properties to frontmatter
655. Import the cleaned directory into gbrain
66
67## CSV Migration
68
69For tabular data (e.g., CRM exports, contact lists):
701. For each row in the CSV, create a page with column values as frontmatter
712. Use a designated column as the slug (e.g., name)
723. Use another column as compiled_truth (e.g., notes)
734. Store each page in gbrain
74
75## Verification
76
77After any migration:
781. Check gbrain statistics to verify page count matches source
792. Check gbrain health for orphans and missing embeddings
803. Export pages from gbrain for round-trip verification
814. Spot-check 5-10 pages by reading them from gbrain
825. Test search: search gbrain for "someone you know is in the data"
83
84## Anti-Patterns
85
86- **Bulk import without sample test.** Never import the full dataset before verifying with 5-10 files. The cost of cleaning up hundreds of bad pages is enormous.
87- **Destroying source data.** Migration is additive. Never modify, move, or delete the source files.
88- **Ignoring cross-references.** Wikilinks, block refs, and tags from the source system must be converted to gbrain equivalents. Dropping them loses the knowledge graph.
89- **Skipping verification.** A migration without post-import health check, page count comparison, and spot-check reads is incomplete.
90
91## Output Format
92
93```
94MIGRATION REPORT -- [source] -> GBrain
95=======================================
96
97Source: [format] ([file count] files, [size])
98Mapping: [field mapping summary]
99
100Sample Test (N files):
101- Imported: N/N
102- Round-trip verified: N/N
103- Cross-refs converted: N
104
105Bulk Import:
106- Total imported: N
107- Skipped (duplicates/errors): N
108- Links created: N
109- Tags migrated: N
110
111Verification:
112- Page count match: [yes/no]
113- Health check: [pass/fail]
114- Search test: [query] -> [result count] hits
115```
116
117## Tools Used
118
119- Store/update pages in gbrain (put_page)
120- Read pages from gbrain (get_page)
121- Link entities in gbrain (add_link)
122- Tag pages in gbrain (add_tag)
123- Get gbrain statistics (get_stats)
124- Check gbrain health (get_health)
125- Search gbrain (query)