Backup & Restore
Navigate to yStore → Backup & Restore.
The Backup & Restore section is only visible to Craft admins with Allow Admin Changes enabled. It does not appear for standard admin users.
The backup system snapshots yStore's configuration and data into a portable, compressed JSON file (.json.gz). Backups can be restored to the same site or migrated to another environment — useful for staging → production deployments, disaster recovery, or configuration rollbacks.
What is backed up
A backup captures yStore's own data — not Craft's native content or database tables. The backup includes:
| Domain | What's included |
|---|---|
| Store | Store views, currencies, tax rates, tax categories |
| Products | Product types, attributes, attribute values |
| Marketing | Coupons, catalog rules, customer rules, email templates, flow definitions |
| Settings | All plugin settings (checkout, orders, marketing, customer, etc.) |
| Order statuses | Custom order status definitions |
| Shipping | Shipping methods, zones, fees, rules, table rates |
| Payment | Payment method configurations |
- Orders, customers, products — these are live transactional data and too large for config backups
- Craft native entries, assets, users — use Craft's own backup for those
- Gift card codes and account balances
Creating a backup
- Go to
yStore → Backup & Restore. - Click Create Backup.
- Optionally select which store views (domains) to include — useful for multi-store setups where you want to back up only specific stores.
- Click Confirm. The backup is created immediately and appears in the backup list.
Backups are stored in storage/yui/backups/ as compressed .json.gz files. Each backup record stores:
| Field | Description |
|---|---|
| File name | backup-YYYYMMDD-HHmmss-{random}.json.gz |
| Plugin version | yStore version at the time of backup |
| Craft version | Craft CMS version at the time of backup |
| Environment | The Craft environment (production, staging, etc.) |
| Record count | Number of records included |
| File size | Compressed file size |
| Checksum | SHA-256 checksum for integrity verification |
Downloading a backup
Click Download next to any backup in the list. The .json.gz file downloads to your machine. Keep this file — it is the only copy outside of the server's storage/ directory.
Restoring a backup
- From a stored backup
- From a file upload
- Find the backup in the list.
- Click Restore.
- Choose a conflict policy (see below).
- Optionally run a Dry Run first to preview what would change without applying anything.
- Click Confirm Restore.
A restore log entry is created for every restore attempt (dry-run or live). Download the log from the restore history to review what was applied.
If the backup file is not on the current server (e.g. restoring from a download):
- Scroll to the Manual Restore section.
- Either upload a
.jsonor.json.gzbackup file, or paste raw JSON content. - Click Restore.
File size limit: 10 MB. For larger backups, place the file directly in storage/yui/backups/ and refresh the backup list.
Conflict policies
When restoring, existing records may conflict with backup records. Choose how to handle conflicts:
| Policy | Behaviour |
|---|---|
| Overwrite (default) | Existing records are updated with backup values |
| Skip on conflict | Conflicting records are left as-is; only missing records are created |
| Fail fast | Stop the entire restore if any conflict is encountered |
Always run a dry-run restore on production before applying. The dry-run shows exactly which records would be created, updated, or skipped — without touching any data.
Restore history
The Restore History table shows all past restore operations (including dry runs). Each entry records:
- Date and time
- Mode (dry-run or live)
- Backup source (stored ID or manual upload)
- Summary (records created, updated, skipped)
- Download link for the full restore log
Pruning
Backups accumulate over time. Use the prune controls to keep storage tidy:
| Action | Default keep | Description |
|---|---|---|
| Prune Backups | Keep latest 50 | Deletes old backup files and records |
| Prune Restore History | Keep latest 200 | Deletes old restore log entries |
Both prune operations delete the oldest entries first, keeping the most recent n records.
Backup integrity
Every backup includes a checksum (SHA-256 of the payload). Before a restore is applied, the checksum is verified automatically. If the file has been corrupted or tampered with, the restore is blocked with an error.
CLI commands
# Create a backup from the command line
php craft yui/backups/create
# Create a backup for specific store views
php craft yui/backups/create --domains=sk,cz
# List all stored backups
php craft yui/backups/list
# Prune old backups (keep latest N)
php craft yui/backups/prune --keep=50
# Restore from a backup file by ID
php craft yui/backups/restore --id=12
# Restore with dry-run
php craft yui/backups/restore --id=12 --dry-run
# Restore with a specific conflict policy
php craft yui/backups/restore --id=12 --conflict=skip-on-conflict
Recommended workflow
Staging → Production deployment:
- On staging:
yStore → Backup & Restore → Create Backup→ Download - On production: Manual Restore → Upload the file → Dry Run → Review log → Live Restore
Before a major settings change:
- Create a backup
- Make your changes
- If something goes wrong, restore the backup with Overwrite policy