Skip to content

Sync and Backup

1. First distinction: sync is not backup

  • WebDAV Sync keeps app setting data consistent across devices (with last sync time and error state).
  • WebDAV Backup creates versioned snapshots of local library data for disaster recovery.
  • Both use WebDAV, but goals are different: sync is for state consistency, backup is for rollback and restore.

2. Backup prerequisites

For backup to succeed, all conditions must be met:

  1. WebDAV is enabled and server URL is reachable.
  2. Current account has a local library (only local libraries support backup/restore).
  3. Local library backup is enabled.
  4. Backup password is provided (required when enabling backup; optional remember-password setting).

If any condition is missing, backup can fail or be disabled.

3. Connection settings recommendations

In server connection settings, configurable fields include:

  • Server URL
  • Username / Password
  • Auth Mode (Basic or Digest)
  • Root Path (default: /MemoFlow/settings/v1)
  • Ignore TLS Errors (not recommended for long-term usage)

Practical recommendations:

  • Prefer HTTPS; avoid long-term TLS bypass.
  • Keep Root Path in a dedicated directory, do not mix with other apps.
  • URL and path are normalized on save (for example removing duplicate slashes).

4. What manual backup actually does

When clicking Start Backup, the flow is:

  1. Trigger a sync first to flush pending changes.
  2. Export local library memos (including archived) and readable attachments.
  3. Build snapshot and upload to WebDAV.
  4. Update backup index and latest backup timestamp.

This means the backup source is current local library state, not a raw full copy of server database.

5. Auto-backup trigger rules

Auto-backup is not a persistent background scheduler. It checks on app resume:

  • Backup schedule is not manual (daily or weekly).
  • Time since last backup exceeds schedule interval.
  • Backup password is saved (without saved password, auto-backup does not run).

If stable auto-backup is required, enable remember-password.

6. Retention and storage

Retention count controls how many snapshot versions are kept (minimum 1, default 5).
When retention limit is exceeded, old snapshots are cleaned. Object storage is reclaimed via reference counting to avoid unlimited growth.

Simple tradeoff:

  • Higher retention = more restore points.
  • Higher retention = usually more storage usage.

7. Restore flow and impact

When clicking Restore from Cloud, the flow is:

  1. Read or request backup password.
  2. Select one snapshot (time, memo count, file count, size are shown).
  3. Confirm and execute restore.

Restore performs:

  • Clear current local library files.
  • Clear local attachment cache.
  • Write back snapshot files.
  • Clear sync queue and rescan local library.

Restore is an overwrite operation. Verify snapshot selection carefully before execution.

8. Security model

Backup payload is not uploaded in plain text:

  • AES-GCM-256 encryption
  • Password-derived key by PBKDF2(HMAC-SHA256) (default 200000 iterations)
  • Key separation by HKDF for different purposes
  • Snapshot and index are both encrypted before upload

9. Common failure causes

If backup/restore fails, check in this order:

  1. WebDAV URL validity and reachability.
  2. TLS/certificate issues (especially self-signed setups).
  3. Whether current account has local library.
  4. Backup password correctness.
  5. Whether cloud side actually has available snapshots.
  1. Complete WebDAV connection and run one manual sync.
  2. Enable local library backup and set password.
  3. Run one manual backup.
  4. Immediately run a small restore drill.
  5. Then enable daily or weekly schedule.