How to inspect, query, and export your BaseStudio Markdown notes (.base) and SQLite databases (.basestudio) using standard tools — no BaseStudio required.
BaseStudio is closed-source desktop and plugin software, but your data is never locked inside a proprietary format. If you delete BaseStudio tomorrow, every record, property, note body, and attachment stays readable with ordinary tools already on your machine.
Option 1: Vault Bases (.base + .md)
Section titled “Option 1: Vault Bases (.base + .md)”A vault Base stores nothing outside your folder:
- Each record is a standard
.mdMarkdown file with YAML front matter. - The Base definition (filters, views, formulas, column types) is a plain-text
.baseYAML file that Obsidian Bases opens directly.
You can inspect or search every record from any terminal or text editor:
# Inspect one recordcat Projects/"Website redesign.md"
# Query every record's status across the foldergrep -n '^status:' Projects/*.md
# Open the Base definition itselfcat Projects/Projects.baseBecause every record is a plain file, git, ripgrep, Obsidian, VS Code, or any script can read and archive your vault
without installing BaseStudio.
Option 2: Single-file databases (.basestudio)
Section titled “Option 2: Single-file databases (.basestudio)”A .basestudio file is a standard SQLite 3 database (PRAGMA application_id = 0x42534442, ASCII BSDB, schema
version 5). It even carries a plain-text specification of its own schema inside the meta table so future-you does not
need these docs to read it.
1. Read the built-in format guide inside the file
Section titled “1. Read the built-in format guide inside the file”sqlite3 ~/Documents/Projects.basestudio "SELECT value FROM meta WHERE key = 'format';"That single query prints the table layout, view names, and rules embedded in every .basestudio file.
2. Query live records with the notes view
Section titled “2. Query live records with the notes view”BaseStudio creates a convenience SQL view called notes that excludes trashed rows (deleted_at IS NULL) and returns
each record’s path, full Markdown source (YAML front matter + body), parsed JSON properties, and timestamps:
sqlite3 -header -column ~/Documents/Projects.basestudio \ "SELECT path, json_extract(properties, '$.status') AS status, updated_at FROM notes ORDER BY updated_at DESC LIMIT 10;"To read the complete Markdown file (front matter + body) of a record:
sqlite3 ~/Documents/Projects.basestudio \ "SELECT source FROM notes WHERE path LIKE '%Website redesign.md';"3. Inspect every table and .base definition
Section titled “3. Inspect every table and .base definition”A .basestudio file can hold multiple tables (Bases). The main table’s .base YAML lives in meta, and any additional
tables live in bases:
# Main Base YAML definition and pathsqlite3 ~/Documents/Projects.basestudio \ "SELECT key, value FROM meta WHERE key IN ('basePath', 'base');"
# Additional tables in a multi-table databasesqlite3 ~/Documents/Projects.basestudio \ "SELECT path, updated_at FROM bases ORDER BY path;"4. Inspect version history, trash, and attachments
Section titled “4. Inspect version history, trash, and attachments”| Table / View | What it holds |
|---|---|
notes (view) |
All live records (deleted_at IS NULL): path, source (full Markdown), properties JSON |
records |
All records including trashed rows (deleted_at IS NOT NULL) |
meta |
Key/value metadata: base, basePath, format, seq |
bases |
Additional .base YAML definitions in a multi-table database |
record_versions |
Earlier saved versions of each record (up to 50 per record) |
base_versions |
Earlier saved versions of .base definitions |
attachments |
Binary files (path, mime, size, data BLOB) linked by records |
registers |
Per-field hybrid logical clock values used to merge concurrent edits across sync services |
To list stored attachments or inspect older versions of a record:
# List attachments stored inside the databasesqlite3 -header -column ~/Documents/Projects.basestudio \ "SELECT path, mime, size FROM attachments ORDER BY path;"
# List earlier versions of a recordsqlite3 -header -column ~/Documents/Projects.basestudio \ "SELECT seq, path, saved_at FROM record_versions ORDER BY seq DESC LIMIT 10;"5. Export every record and attachment to plain files with Python
Section titled “5. Export every record and attachment to plain files with Python”If you no longer have BaseStudio installed and want to unpack a .basestudio file into an ordinary folder of Markdown
notes, .base files, and attachments, Python’s built-in sqlite3 module does it in ~25 lines:
import pathlib, sqlite3, sys
db_path = pathlib.Path(sys.argv[1])out_dir = pathlib.Path(sys.argv[2])conn = sqlite3.connect(db_path)
def write_file(rel_path: str, data: str | bytes) -> None: target = out_dir / rel_path target.parent.mkdir(parents=True, exist_ok=True) if isinstance(data, bytes): target.write_bytes(data) else: target.write_text(data, encoding="utf-8")
meta = dict(conn.execute("SELECT key, value FROM meta WHERE key IN ('basePath', 'base')"))if "basePath" in meta and "base" in meta: write_file(meta["basePath"], meta["base"])
for path, source in conn.execute("SELECT path, source FROM bases"): write_file(path, source)
for path, source in conn.execute("SELECT path, source FROM notes"): write_file(path, source)
for path, blob in conn.execute("SELECT path, data FROM attachments"): write_file(path, blob)Run it with:
python3 unpack_basestudio.py ~/Documents/Projects.basestudio ./exported-projectsNote on
.bschangesfiles: While BaseStudio is open, recent edits may briefly sit in a sidecarName.<id>.<writer>.<session>.bschangesfile beside the.basestudiodatabase before folding in (after 30 seconds of idle time or on close). Close BaseStudio — or use File → Save a copy… — before archiving a.basestudiofile so every change is folded into the SQLite file.
Related reading
Section titled “Related reading”- Database files — how multi-app editing,
.bschanges, and sync merging work. - The .base file — exact YAML structure of Obsidian
.basefiles and the MIT-licensedbases-contractschema. - One SQLite file that survives sync conflicts — engineering deep dive on conflict-free database syncing.