Skip to main content
Version: 2.0.0

Backup & Restore

Navigate to yStore → Backup & Restore.

Admin only

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:

DomainWhat's included
StoreStore views, currencies, tax rates, tax categories
ProductsProduct types, attributes, attribute values
MarketingCoupons, catalog rules, customer rules, email templates, flow definitions
SettingsAll plugin settings (checkout, orders, marketing, customer, etc.)
Order statusesCustom order status definitions
ShippingShipping methods, zones, fees, rules, table rates
PaymentPayment method configurations
What is NOT backed up
  • 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

  1. Go to yStore → Backup & Restore.
  2. Click Create Backup.
  3. Optionally select which store views (domains) to include — useful for multi-store setups where you want to back up only specific stores.
  4. 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:

FieldDescription
File namebackup-YYYYMMDD-HHmmss-{random}.json.gz
Plugin versionyStore version at the time of backup
Craft versionCraft CMS version at the time of backup
EnvironmentThe Craft environment (production, staging, etc.)
Record countNumber of records included
File sizeCompressed file size
ChecksumSHA-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

  1. Find the backup in the list.
  2. Click Restore.
  3. Choose a conflict policy (see below).
  4. Optionally run a Dry Run first to preview what would change without applying anything.
  5. 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.

Conflict policies

When restoring, existing records may conflict with backup records. Choose how to handle conflicts:

PolicyBehaviour
Overwrite (default)Existing records are updated with backup values
Skip on conflictConflicting records are left as-is; only missing records are created
Fail fastStop the entire restore if any conflict is encountered
Use dry run first

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:

ActionDefault keepDescription
Prune BackupsKeep latest 50Deletes old backup files and records
Prune Restore HistoryKeep latest 200Deletes 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

Staging → Production deployment:

  1. On staging: yStore → Backup & Restore → Create Backup → Download
  2. On production: Manual Restore → Upload the file → Dry Run → Review log → Live Restore

Before a major settings change:

  1. Create a backup
  2. Make your changes
  3. If something goes wrong, restore the backup with Overwrite policy