Backup & Restore
Create, import, validate, restore, schedule, and delete CW backups.
Use Backup & Restore in Settings → Maintenance to protect local CW data.
It was added in v0.9.23.
Backups are ZIP files.
They are not encrypted.
If a backup includes config.json and .cw_master_key, treat it like credentials.
What you can do
Use Backup & Restore to:
create a backup
import an older backup
validate before restore
restore a saved backup
schedule automatic backups
download or delete stored archives
Backups are stored under:
/config/backupsPick the right backup type
Config
App settings only
config.json and .cw_master_key when present
Normal
Routine backups
Config plus core app state
Full
Upgrades, migrations, or larger cleanup work
Everything in Normal, plus snapshots, tracker data, reports, and backup cache data
Full backups can get large fast.
That is normal when many snapshots or reports exist.
Common tasks
Create a backup
Open Settings → Maintenance → Backup & Restore.
Open Manual Backup.
Choose Config, Normal, or Full.
Add a label.
Select Create Backup.

The label shows in the UI.
It is saved in metadata only.
Validate a backup
Validate before restore, especially for imported or older files.
Open Backup & Restore.
Find the backup.
Select the validation icon.
Success shows Successfully validated.
Restore a backup
Open Backup & Restore.
Find the backup.
Validate it if needed.
Select the restore icon.
Confirm the restore.
Before restore, CW creates a fresh Normal backup with the pre_restore trigger.
After restore, CW requests a restart.
Your container or service manager should start it again.
Restore replaces only files inside the backup.
It does not delete extra local files outside the archive.
Import a backup
Open Manual Backup.
Select Import.
Choose a
.zipfile.Wait for upload and validation.
Imported backups are stored under:
Limits:
only
.zipfiles are acceptedmaximum upload size is
2 GBfailed validation deletes the imported file
Download or delete a backup
Each backup entry lets you:
download
validate
restore
delete
Deleting removes the ZIP from disk.
Keep a second copy for long-term retention.
Schedule backups
Use Scheduled Backups to run backups automatically.
You can set:
enabled or disabled
backup type
start time
weekdays
retention days
maximum backup count
Default values:
Scope:
NormalTime:
03:00Retention:
30daysMaximum backups:
10Automatic deletion: enabled
If no weekdays are selected, the schedule runs every day.
CW uses the main scheduling timezone.
If none is set, it uses the host or container local time.
If a sync is running, the backup waits until that sync ends.
Retention rules
Retention can use both age and count.
CW:
deletes backups older than the age limit
deletes the oldest remaining backups until the count limit is met
Retention applies to the whole backup directory.
It can delete manual, imported, and pre_restore backups too.

Recommended use
Use Normal for regular protection.
Use Full before bigger changes.
Download important backups outside
/config/backups.Validate imported backups before restore.
Keep the original external config key.
Confirm the service restarts automatically.
Test restore before you need it.
Advanced reference
Exact contents of each backup type
Only the listed files and directories are included.
The backup directory itself is excluded.
Symbolic links are excluded too.
Config contents
config.json.cw_master_key
Normal contents
config.json.cw_master_keystate.jsonlast_sync.jsonstatistics.jsonwatchlist_hide.json.cw_statetls
Full contents
Everything in Normal, plus:
snapshots.cw_providersync_reports.cw_cache
Files such as tombstones.json, arbitrary files under /config, and the regular cache directory are not included by the standard interface.
Manifest, encryption, and key handling
Every backup includes manifest.json.
The manifest records:
backup type and schema version
created time and CW version
selected scope and user label
trigger, such as
manual,scheduler, orpre_restoreincluded files, sizes, and SHA256 checksums
total file count and total uncompressed size
encryption and key requirements
The current schema version is 1.
Backups are compressed.
They are not encrypted.
When .cw_master_key exists, CW includes it in Config, Normal, and Full backups.
Key state is recorded as one of:
Key included
External key required
No key needed
If a backup requires an external key, restore is blocked unless CW_CONFIG_KEY or CROSSWATCH_CONFIG_KEY is configured.
The value must match the original key.
Related: Config encryption
Validation and restore behavior
Validation checks:
file exists under
/config/backupsarchive is a ZIP
size is no larger than
2 GBentry count is no larger than
100000ZIP integrity test succeeds
manifest.jsonexists and is no larger than5 MBbackup type and schema version are valid
every path resolves to an allowed restore location
every expected file exists
archived sizes match the manifest
SHA256 checksums match
Validation also blocks path traversal and writes outside the CW config directory.
Restore runs in this order:
validate the backup
check external key requirements
create a fresh Normal
pre_restorebackupextract only listed files
write each restored file to a temporary file
replace the current file
request a restart
Each file replacement is atomic.
The full restore is not one atomic transaction.
If one file fails, earlier restored files stay changed.
Scheduled retention internals and security protections
Scheduled runs are recorded so the same slot does not run twice.
If CW starts after the scheduled time passed, it marks that slot as missed.
It does not run a catch-up backup.
Retention cleanup runs only after a scheduled backup succeeds.
Built-in safeguards include:
fixed allowed backup and restore paths
rejection of absolute paths and
..traversalfixed restore allowlist
symbolic link exclusion
labels never used in archive paths
validation before imported backups are kept
checksum and size checks on every restored file
fixed public API error codes
no internal exception details returned to the browser
backup downloads disable browser caching and content-type guessing
API endpoints
GET /api/backups/listPOST /api/backups/createGET /api/backups/downloadPOST /api/backups/validatePOST /api/backups/restorePOST /api/backups/deletePOST /api/backups/uploadGET /api/backups/schedulePOST /api/backups/schedulePOST /api/backups/retention
All backup API responses disable browser caching.
Common error codes:
backup_create_failedbackup_validate_failedbackup_restore_failed
Related pages
Last updated
Was this helpful?