A Python script to migrate your Logseq graph to Obsidian format with enhanced features and robust error handling.
- Frontmatter Conversion: Adds YAML frontmatter with dates and titles
- Journal Renaming: Converts journal files from
YYYY_MM_DD.mdtoYYYY-MM-DD.mdformat - Status Tags: Converts Logseq task status to Obsidian-compatible format
- Property Stripping: Removes Logseq-specific properties
- Block References: Converts Logseq block references to Obsidian format
- Error Handling: Robust YAML parsing with graceful error handling
- Dry Run Support: Test migrations before applying changes
- Clone this repository:
git clone https://github.com/yourusername/logseq-to-obsidian-migration.git
cd logseq-to-obsidian-migration- Create a virtual environment:
python3 -m venv logseq_env
source logseq_env/bin/activate # On Windows: logseq_env\Scripts\activate- Install dependencies:
pip install pyyamlpython3 logseq_to_obsidian.py --src /path/to/logseq/graph --out /path/to/obsidian/vault --frontmatter --status-tags --strip-properties --rename-journalspython3 logseq_to_obsidian.py --src /path/to/logseq/graph --out /path/to/obsidian/vault --frontmatter --status-tags --strip-properties --rename-journals --dry-run--src: Source Logseq graph directory (required)--out: Output Obsidian vault directory (optional, defaults to in-place conversion)--dry-run: Test the migration without making changes--frontmatter: Add YAML frontmatter to files--status-tags: Convert task status to tags--strip-properties: Remove Logseq properties--rename-journals: Rename journal files to hyphen format
TODO→[ ]with#status/todotagDOING→[ ]with#status/doingtagDONE→[x]with#status/donetagLATER→[ ]with#status/latertagWAITING→[ ]with#status/waitingtag
2023_09_04.md→2023-09-04.md
((uuid))→[[page-title#^uuid]]
#[[Tag With Spaces]]→#tag-with-spaces
[[2023_09_04]]→[[2023-09-04]]
Before (Logseq):
- TODO Complete project proposal
- DONE Review documentation
tags:: project, workAfter (Obsidian):
---
tags: [project, work]
date: '2023-09-04'
---
- [ ] Complete project proposal #status/todo
- [x] Review documentation #status/done- Python 3.6+
- PyYAML
MIT License - see LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.