0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Obsidianを使ってみた(couchdb)

0
Posted at

内容

NotionからObsidianに乗り換えてみた。自宅にある適当なLinuxサーバにdockerを入れ、保管庫同期の設定をしました。個人的な備忘録として残します。

手順

大雑把な流れは以下の通り。

  • 適当なサーバでdockerにて、couchdb - Official Image | Docker Hub を起動させる
    • COUCHDB_USERCOUCHDB_PASSWORDを適切に設定
  • Obsidianをインストール
  • 設定でCommunity pluginsを有効化
  • 「Self-hosted LiveSync」をインストール
    • 設定で、couchdbに指定したuser, passwordを設定

これでセルフホストでObsidianに作成したノートの同期ができるようになりました。

Couchdbのバックアップ

https://github.com/danielebailo/couchdb-dump
こちらのスクリプトを使わせてもらいます。

docker exec -it <container_name> bash
curl -OL https://raw.githubusercontent.com/danielebailo/couchdb-dump/refs/heads/master/couchdb-dump.sh
chmod +x couchdb-dump.sh
./couchdb-dump.sh -b -H localhost -d obsidian -f dump.json -u admin -p password
exit
docker cp <container_name>:dump.json .

-u admin -p passwordには、それぞれ設定したCOUCHDB_USERCOUCHDB_PASSWORDを適切に設定してください。
リストアは以下のコマンドを実行します。

./couchdb-dump.sh -r -c -H localhost -d obsidian -f dump.json  -u admin -p password
# -c オプションでcreate database automatically.

また、ホスト <-> dockerインスタンスで、ディレクトリ共有しても良さそうです。
(dockerのオプションにて(-v ./data/:/opt/couchdb/data/

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?