Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Expert guidance for migrating Logseq graphs from Markdown (MD) format to the new Database (DB) format. Auto-invokes when users ask about MD to DB migration, converting graphs, import options, data transformation, or compatibility between Logseq versions. Covers migration strategies, common issues, and best practices.
.claude/skills/aiskillstore-migrating-to-db/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 0% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 46% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 49% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 115% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 78% | 0% |
This skill auto-invokes when:
You are an expert in migrating Logseq graphs from MD (Markdown) format to DB (Database) format.
| Feature | MD Version | DB Version | |---------|------------|------------| | Storage | Markdown files | SQLite database | | Tags | Page references | Classes with properties | | Properties | Text strings | Typed values | | Queries | Limited | Full Datalog | | Sync | File-based | Real-time (subscription) | | Performance | File I/O dependent | Optimized queries |
Important: Logseq DB is still in alpha. Consider:
Before migrating, assess your graph:
bash# Create timestamped backup cp -r ~/logseq/my-graph ~/logseq/my-graph-backup-$(date +%Y%m%d) # Or compress tar -czvf my-graph-backup.tar.gz ~/logseq/my-graph
Pages to review:
Properties to review:
Tags to review:
| MD Pattern | DB Options | Decision Needed | |------------|------------|-----------------| | #tag | Class or page ref | Which tags become classes? | | [[page]] | Node reference | Keep as reference | | property:: value | Typed property | What type? | | namespace/page | Separate page or hierarchy | Flatten or nest? |
When importing to DB, you'll choose:
Tag Handling:
Namespace Handling:
a/b/c → single page "a/b/c"Property Handling:
clojure;; Check page count matches [:find (count ?p) :where [?p :block/tags ?t] [?t :db/ident :logseq.class/Page]] ;; Check for orphaned blocks [:find (pull ?b [:block/title]) :where [?b :block/title _] (not [?b :block/page _]) (not [?b :block/tags ?t] [?t :db/ident :logseq.class/Page])] ;; Verify properties migrated [:find ?prop-name (count ?b) :where [?b ?prop _] [?p :db/ident ?prop] [?p :block/title ?prop-name] [(clojure.string/starts-with? (str ?prop) ":user.property")]]
Symptom: Numbers/dates stored as strings
Solution: Manually update property types
clojure;; In DB, update property type {:db/ident :user.property/rating :logseq.property/type :number} ; was :default
Symptom: Tags didn't become proper classes
Solution: Convert pages to classes
#Tag to make it a classSymptom: [[page]] links not working
Cause: Page names changed during migration
Solution: Use find/replace or query to identify broken refs
clojure[:find ?ref-text :where [?b :block/title ?title] [(re-find #"\[\[.*?\]\]" ?title) ?ref-text] (not [_ :block/title ?ref-text])]
Symptom: project/tasks and project/notes merged
Solution: Pre-migration, rename pages to avoid conflicts
Symptom: Old queries don't work
Reason: Different attribute names
| MD Attribute | DB Attribute | |--------------|--------------| | :block/content | :block/title | | :block/name | :block/title | | :page/tags | :block/tags |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 29,095 | 21,898 | -25% | 1 | 1 | 0% | 3,986 | 3,997 | +0% | 0 | 0 | — |
case-02 | fail→pass | 22,572 | 12,405 | -45% | 1 | 1 | 0% | 2,868 | 4,186 | +46% | 0 | 0 | — |
case-03 | fail→pass | 26,800 | 23,504 | -12% | 1 | 1 | 0% | 3,263 | 4,863 | +49% | 0 | 0 | — |
case-04 | pass→pass | 15,650 | 11,821 | -24% | 1 | 1 | 0% | 2,717 | 4,001 | +47% | 0 | 0 | — |
case-05 | pass→pass | 7,588 | 7,891 | +4% | 1 | 1 | 0% | 1,486 | 3,418 | +130% | 0 | 0 | — |
case-06 | pass→fail | 20,615 | 18,591 | -10% | 1 | 1 | 0% | 2,511 | 4,196 | +67% | 0 | 0 | — |
case-07 | fail→pass | 14,171 | 8,124 | -43% | 1 | 1 | 0% | 1,628 | 3,497 | +115% | 0 | 0 | — |
case-08 | pass→pass | 25,945 | 26,531 | +2% | 1 | 1 | 0% | 2,402 | 3,834 | +60% | 0 | 0 | — |
case-09 | fail→pass | 12,796 | 14,639 | +14% | 1 | 1 | 0% | 1,968 | 3,507 | +78% | 0 | 0 | — |
case-10 | fail→pass | 18,645 | 14,226 | -24% | 1 | 1 | 0% | 2,112 | 3,445 | +63% | 0 | 0 | — |
case-11 | fail→fail | 16,473 | 17,455 | +6% | 1 | 1 | 0% | 2,311 | 3,803 | +65% | 0 | 0 | — |
case-12 | fail→pass | 24,461 | 11,680 | -52% | 1 | 1 | 0% | 3,280 | 3,111 | -5% | 0 | 0 | — |
case-13 | pass→pass | 17,132 | 17,960 | +5% | 1 | 1 | 0% | 2,486 | 4,483 | +80% | 0 | 0 | — |
case-14 | pass→pass | 20,333 | 13,872 | -32% | 1 | 1 | 0% | 2,184 | 3,960 | +81% | 0 | 0 | — |
case-15 | fail→pass | 13,496 | 12,293 | -9% | 1 | 1 | 0% | 2,297 | 3,245 | +41% | 0 | 0 | — |
case-16 | pass→pass | 16,950 | 15,976 | -6% | 1 | 1 | 0% | 2,041 | 3,587 | +76% | 0 | 0 | — |
case-17 | fail→pass | 11,892 | 7,947 | -33% | 1 | 1 | 0% | 1,679 | 2,434 | +45% | 0 | 0 | — |
case-18 | pass→pass | 29,496 | 12,646 | -57% | 1 | 1 | 0% | 3,179 | 3,258 | +2% | 0 | 0 | — |
case-19 | fail→fail | 23,119 | 18,837 | -19% | 1 | 1 | 0% | 2,809 | 4,228 | +51% | 0 | 0 | — |
case-20 | pass→pass | 9,269 | 8,683 | -6% | 1 | 1 | 0% | 1,475 | 2,509 | +70% | 0 | 0 | — |
case-21 | pass→pass | 11,321 | 3,524 | -69% | 1 | 1 | 0% | 1,686 | 2,422 | +44% | 0 | 0 | — |
case-22 | fail→pass | 19,891 | 5,180 | -74% | 1 | 1 | 0% | 2,248 | 2,690 | +20% | 0 | 0 | — |
case-23 | pass→pass | 26,313 | 16,058 | -39% | 1 | 1 | 0% | 3,269 | 3,814 | +17% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +39 percentage points is the difference between those two pass rates over the 23 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.