Skip to main content
Version: 2.0.0

Settings

This page explains every Backup setting and where to find it. Open settings in Craft CP:

Backup -> Settings (yui-backup/settings).

There is a single settings screen — Retention.

Retention

  • Keep latest backups (keepLatest, default 50, minimum 1): maximum number of backup files to keep when pruning. Pruning (manual or automatic) deletes the oldest backups beyond this count, along with their files and any restore history rows that reference them.
  • Keep restore history entries (keepHistoryLatest, default 200, minimum 1): maximum number of restore history rows to keep when pruning restore history. Pruning also deletes the associated log files.
  • Auto-prune after backup (autoPruneEnabled, default off): when on, the plugin automatically prunes old backups and restore history right after each new backup is created, using the two limits above.

How pruning actually runs

The retention numbers on this page are only used automatically if Auto-prune after backup is on. Otherwise, pruning happens only when an admin explicitly clicks Prune old or Prune history on the Dashboard — and those two buttons on the Dashboard have their own inline "keep latest" number fields (defaulting to 50 and 200), which are independent of the values saved here. Set both places consistently if you rely on manual pruning with a non-default retention count.

There is currently no scheduled/cron pruning built in — combine the console command with Auto-prune after backup if you want retention enforced without a manual step, or add your own scheduled task calling the prune actions.

Validation and save behavior

  • Keep latest backups and Keep restore history entries must be integers of at least 1. Internally, values above 1000 are clamped down to 1000 when a prune actually runs.
  • Saving redirects back to yui-backup/settings and shows a Craft success/error notice as usual.
  1. Decide how many backups and how much restore history you realistically need for your environment (disk usage grows with both), and set Keep latest backups / Keep restore history entries accordingly.
  2. Turn on Auto-prune after backup if backups run frequently (e.g. via a daily cron job using the console command) and you don't want to prune manually.
  3. If you prune manually from the Dashboard instead, remember to type the same retention numbers into the inline prune fields — they don't read from this settings page.
  4. Periodically check Restore History on the Dashboard for failed restores, and download the log for any failed or partial entry to see what went wrong.

Troubleshooting

Backups keep accumulating even though a retention limit is set

Confirm Auto-prune after backup is actually on. If you're pruning manually, make sure the "keep latest" number typed into the Dashboard's Prune old / Prune history field matches what you intended — those fields don't read the saved settings value.

A restore reports success but nothing changed

This plugin only builds and validates the backup/restore payload; the actual writes are performed by a listener on BackupService::EVENT_RESTORE_ENTITIES, registered by yui/craft-plugin. If yui/craft-plugin isn't installed or active, no listener runs and a restore can report a "success" status with an empty summary. See Requirements.

Restore fails validation immediately

The uploaded or stored file's schemaVersion or checksum doesn't match what the plugin expects — this happens if the file was hand-edited, truncated, or created by a different (incompatible) schema version. Use an unmodified backup file downloaded from the same or a compatible environment.