vrtmrz / obsidian-livesync

MIT License
5.16k stars 168 forks source link

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

Open 1221141 opened 6 months ago

1221141 commented 6 months 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 5 months 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 5 months ago

Why not just backup your database?

vrtmrz commented 5 months 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.

phxyz12 commented 2 months ago

Personally, I use the Git plugin in parallel to live sync. Whenever I want to have a backup, I push the local repo to my GitLab instance. By doing this, I not only have a backup, but also a complete commit histroy from which I can compare versions of notes and revert to older verions of a particular note.

The Git plugin handles all committing and pushing in the background. You can assign the commit & push process to a key in Obsidian and so all you do is hitting the assigned key and that's it.