Import and backup

On this page

Bring your notes in with one command, read any note back as plain Markdown, and keep a backup of the whole vault.

Import from Obsidian#

notegraph import ~/path/to/your/vault

Import reads a folder of Markdown notes and attachments. Each note becomes one change by import, and the whole run is one session, so you can undo it as one. Links, frontmatter and tags are read from the note text. Your Obsidian folder does not change.

To undo an import, find its session with notegraph log --actor import and run notegraph revert --session <id> --dry-run to see the plan. See Undo an agent session.

Import again#

You can run the same import again. A note that has not changed since the last import stays as it is and is counted as unchanged. Only changed notes become new changes. A note whose text changed in the folder becomes one new change, and the earlier text stays in the history.

What import skips#

The report lists each skipped file with its reason. These are skipped:

A note with broken frontmatter is not skipped. It is imported as plain text and listed under parse problems.

Read a note as Markdown#

There is no export command in this version, and notegraph does not keep a Markdown mirror of the vault. To get one note out as the exact bytes that notegraph holds, write it to a file:

notegraph show projects/alpha.md --raw > alpha.md

--raw refuses to write to a terminal. A file you write this way is plain text outside the vault. The deny list does not cover it. See the warning on the privacy page.

Back up and restore#

notegraph backup ~/notegraph.bak

backup writes a copy of the store to a file that does not exist yet. Only you can read the file, and it does not hold your sync secrets. It holds your notes and their full history, in plain form, so keep it where you keep other private files.

notegraph restore ~/notegraph.bak

restore replaces the store with the backup. It asks first, keeps the store it replaced as store.sqlite.pre-restore, and gives this device a new device ID. If sync was on, it tells you what to do next; you may need notegraph pair --recover.