Skip to content

Templates

konna edited this page Jun 9, 2025 · 1 revision

Templates

Konserve supports creating and editing templates to simplify recurring backups. Templates store a list of folder and file paths that you want to include in your backup.


How Templates Work

Each template is stored as a .json file and contains a list of absolute paths. During backup, these paths are used to populate the selection automatically.

Templates:

  • Only store paths (not contents)
  • Can be edited in the GUI or a text editor
  • Automatically skip any invalid or missing paths when loaded

Creating a Template

  1. Use "Add Folders" and "Add Files" to build your selection.
  2. Click "Save Template".
  3. Choose a .json file path to save the template.

Internally, Konserve serializes your selection as:

{
  "paths": [
    "C:\\Users\\YourName\\Documents\\example",
    "C:\\Users\\YourName\\AppData\\Roaming\\app"
  ]
}

Loading a Template

  1. Click "Load Template"
  2. Pick a .json file previously saved
  3. Konserve will:
    • Load all valid paths
    • Skip broken or missing paths
    • Show a status message like:
      • ✅ Template loaded
      • ✅ Loaded with 2 paths skipped

Konserve also applies fix_skip() logic, adjusting user-specific paths (like old usernames).


Editing a Template

  1. Click "Edit Template"
  2. Choose a .json file
  3. The template editor will open:
    • You can manually adjust path text
    • Remove paths
    • Add new ones with a file/folder picker
  4. Click "Save Template" to overwrite or save a new file

Paths are validated inline:

  • ✅ means the path exists
  • ❌ means the path is invalid or missing

File names and extensions must be typed manually if the path points to a specific file.


Notes

  • Template loading automatically applies .sort() and .dedup() to clean up entries
  • Edited templates use fix_skip() to auto-correct paths before display
  • Restored templates can be used without modification if paths are valid
  • Paths can include both folders and files

Best Practices

  • Use descriptive template names like daily-dev-work.json or browser-data.json
  • Store templates alongside backups or in a synced cloud folder
  • Regularly update templates to reflect changes in folder structure

Next: Backup Format

Clone this wiki locally