vrtmrz / obsidian-livesync

MIT License
3.92k stars 132 forks source link

How to backup (both couchdb and file storage) to files #439

Open 1221141 opened 1 month ago

1221141 commented 1 month ago

Hi. Thanks for this plugin.

I would like to know if there are any instructions on how to extract the data from couchdb/minio. both seems compressed/encrypted and I couldn't find a easy way to extract the data.

My idea was to have the database to be the source of truth and backup the data from it (extract markdown/assets) and store in a safe place automatically. The couchdb has some children/leavs and they are encoded. the minio solutions were jsonl.gz and i couldn't extract them properly.

Is this doable? If not what are you recommendation to backup the notes?

Thanks in advance

RogerProSelf commented 4 weeks ago

Same requirements here. The synchronization feature of LiveSync is certainly very good, but we also need a regular, snapshot-like feature, which would be much better for version control. LiveSync cannot coexist with other synchronization services, so we cannot use other services like OneDrive or WebDAV for backup purposes.

Thanks in advance!

Hackmodford commented 3 weeks ago

Why not just backup your database?

vrtmrz commented 1 week ago

We apologise for the very late reply! What you want to do is quite understandable.

The backup of CouchDB is usually realised by simply replicating the remote database to the remote database. We can access and operate the remote database with the web UI called Fauxton. (https://your-couchdb.example.com/_utils). We can replicate the database to another or a new one by using that.

Storage-based backup is not recommended. (Maybe backing up our markdown files will be more reliable). For more details, please refer to the official doc.

@RogerProSelf

LiveSync cannot coexist with other synchronization services,

If Self-hosted LiveSync can be stopped during backup or synchronisation with other solutions, this is not a problem in most cases.

When Self-hosted LiveSync is started, a difference check is performed between the storage and the Local Database. If it finds some differences, update the storage or local database. However, please keep the clock of all devices adjusted.

If any device has an unreliable clock, we can run Self-hosted LiveSync in Disable all automatic mode. It can be applied from the preset. If it has been applied, Self-hosted LiveSync just watches the change of files and keeps all changes in the local database, but does not start any replication. Self-hosted LiveSync usually does not write anything to the storage without performing replication.