xiaohongshu
xiaohongshu
migrating-to-db
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...
Full skill instructions
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:
# 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:
;; 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
;; 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
[: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 |
Clean up your graph
Document your structure
Plan your classes
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience