{"id":23260510,"url":"https://github.com/nmasse-itix/bearnotes","last_synced_at":"2025-04-06T05:27:40.858Z","repository":{"id":80604595,"uuid":"307146588","full_name":"nmasse-itix/bearnotes","owner":"nmasse-itix","description":"A tool to migrate notes from Bear to Zettlr","archived":false,"fork":false,"pushed_at":"2021-11-25T15:44:30.000Z","size":32,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-12T11:16:18.466Z","etag":null,"topics":["bear","zettlr"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nmasse-itix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-25T16:53:14.000Z","updated_at":"2021-11-25T15:44:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"ca76cc71-1b09-4b49-9317-605329a98269","html_url":"https://github.com/nmasse-itix/bearnotes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmasse-itix%2Fbearnotes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmasse-itix%2Fbearnotes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmasse-itix%2Fbearnotes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmasse-itix%2Fbearnotes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nmasse-itix","download_url":"https://codeload.github.com/nmasse-itix/bearnotes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247440043,"owners_count":20939196,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bear","zettlr"],"created_at":"2024-12-19T13:17:12.096Z","updated_at":"2025-04-06T05:27:40.820Z","avatar_url":"https://github.com/nmasse-itix.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Migrate your notes from Bear to Zettlr!\n\n## Background\n\nI recently switch from Bear to Zettlr to manage my notes.\nHowever, I was sad to discover that Bear exports notes in a non-standard way:\n\n- File attachments are HTML links that don't even point to the correct file\n- All notes are stored in the same directory, regardless of your tag hierarchy\n- The tag format used by Bear (#foo/bar) is incompatible with Zettlr format (#bar)\n- Bonus: some file attachment were missing...\n\nSo, I decided to write this tool in order to save my hundreds of notes!\n\n## Usage\n\nFirst, export all your notes from Bear.\n\n* Go to **Notes**\n* Hit **Cmd+A** to select all your notes\n* Go to **File** \u003e **Export Notes...**\n* Select **Markdown** and check **Export attachments**\n* Select a directory to store your exported notes\n* Click **Export notes**\n\nThen, install **git** and **go**.\n\n```sh\nbrew install git golang\n```\n\nCheckout this repository.\n\n```sh\ngit clone https://github.com/nmasse-itix/bearnotes.git\ncd bearnotes/cli\n```\n\nStart a discovery of your notes.\n\n```sh\ngo run main.go discover --from /path/to/bear-notes --tag-file /tmp/tags.yaml\n```\n\nIf everything goes well, it should display a count of your exported notes\nalong with the discovered tag list.\n\nYou can review the generated tag configuration file.\n\n```sh\nopen /tmp/tags.yaml\n```\n\nFinally, launch the proper migration phase.\n\n```sh\ngo run main.go migrate --from /path/to/bear-notes --to /path/to/zettlr-notes --tag-file /tmp/tags.yaml\n```\n\nReview the migrated notes.\n\nIf you want to change the default folder hierarchy, read the next section.\n\n## Configuration\n\nYou can configure how the migration tool stores your notes, in which folder and even rewrite the tags to match Zettlr's format.\n\nThe default configuration for a tag is:\n\n```yaml\nfoo/bar:\n    ignore: false\n    handling_strategy: same-folder\n    target_directory: foo/bar\n    target_tag_name: bar\n```\n\nIt defines that any note having this tag will go to the **foo/bar** directory.\nThe **#foo/bar** tag will be rewritten as **#bar**.\nAll the notes having the **#foo/bar** tag, will be stored in the same directory, along with their embedded images and file attachments.\n\nIf you think the migration tool wrongly identified a tag, you can switch the **ignore** option to **true**.\n\n```yaml\nfoo/bar:\n    ignore: true\n```\n\nIf you want to rewrite the **#foo/bar** tag as **#foo-bar**, you can change the **target_tag_name**. \n\n```yaml\nfoo/bar:\n    ignore: false\n    handling_strategy: same-folder\n    target_directory: foo/bar\n    target_tag_name: foo-bar\n```\n\nNote: If you want to remove the tag from the migrated note, use `target_tag_name: \"\"`.\n\nThe `target_directory` option is straightforward: it defines where to store the notes having this tag.\n\nThe `handling_strategy` option specifies how notes will be saved on the filesystem\n\n- **same-folder**: all notes having this tag are stored in the **target_directory** along with their embedded images and file attachments.\n- **one-note-per-folder**: each note will get a sub-folder in the **target_directory**\n\nNote: given that a document can have multiple tags, it is perfectly valid for a tag to specify no target directory or no handling strategy if you know that another tag will provide them. \n\nIf by any chance, for a note the tool cannot determine a target directory or an handling strategy, the note will be stored in the root of the target directory.\n\nAnd if a note receives different configurations by two different tags, the first one wins (by order of tag appearance in the document).\n\n## Filename encoding Between Mac and Linux\n\nIf you took your exported notes from a Mac and migrated them on a Linux box, you might encounter some filename encoding issue. \nHopefully, `convmv` can fix filenames for you!\n\n```sh\nsudo dnf install convmv\nconvmv -f utf-8 -t utf-8 --nfc -r --notest /path/to/bear-notes\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnmasse-itix%2Fbearnotes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnmasse-itix%2Fbearnotes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnmasse-itix%2Fbearnotes/lists"}