Commit 78603a2
committed
refactor(backup): enhance backup functionality with direct backup and legacy backup support (#13030)
### What this PR does
This PR introduces several enhancements to the backup functionality:
1. **Direct Backup**: Implements efficient backup methods that copy
IndexedDB and Local Storage directories directly, avoiding JSON
serialization for better performance
2. **Legacy Backup Rename**: Renames "LAN Transfer Backup" to "Legacy
Backup" for clearer terminology
3. **Component Refactoring**: Splits the large DataSettings.tsx into
smaller components
4. **New Icons**: Adds Joplin and Siyuan icon components
### Before this PR:
- Backup only supported JSON-based serialization
- "LAN Transfer Backup" terminology was used
- All data settings were in a single large component
### After this PR:
- Supports both direct (file copy) and JSON backup formats
- Uses "Legacy Backup" terminology for the former LAN Transfer feature
- Data settings are modularized with separate components
### Why we need it and why was done in this way
The tradeoffs were made:
- Direct backup is faster but may not work across different app versions
- Legacy backup (JSON-based) ensures compatibility but is slower
### Breaking changes
None.
### Special notes for your reviewer
- The DataSettings.tsx was refactored into multiple files - please
review the component structure
- Direct backup format includes metadata for version compatibility
- **Testing status**: macOS backup and restore tested. Windows and Linux
testing pending.
### Checklist
- [x] PR: Expressive enough for future contributors
- [x] Code: Simple and human-readable
- [x] Refactor: Code is cleaner than before
- [x] Upgrade: Impact considered
- [x] Documentation: Not required for this backend/feature change
### Release note
```release-note
- Add direct backup mode, significantly improving backup and restore speed
```1 parent 8dd42eb commit 78603a2
File tree
29 files changed
+1815
-1156
lines changed- src
- main
- services
- __tests__
- utils
- __tests__
- preload
- renderer/src
- components
- Icons
- Popups
- LanTransferPopup
- i18n
- locales
- translate
- pages/settings/DataSettings
- services
29 files changed
+1815
-1156
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | | - | |
| 249 | + | |
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
152 | 156 | | |
| 157 | + | |
153 | 158 | | |
154 | 159 | | |
155 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
108 | 107 | | |
109 | 108 | | |
110 | 109 | | |
| |||
495 | 494 | | |
496 | 495 | | |
497 | 496 | | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
| 497 | + | |
507 | 498 | | |
508 | 499 | | |
509 | 500 | | |
| |||
610 | 601 | | |
611 | 602 | | |
612 | 603 | | |
613 | | - | |
| 604 | + | |
614 | 605 | | |
615 | 606 | | |
616 | 607 | | |
| |||
0 commit comments