Backups & Restore
Full site backups and one-click restoration.
TL;DR
Admin → Backups: click Create Backup for an on-demand full backup. Download, restore, or delete backups from the list. CLI: php spark pubvana:backup. Restore CLI: php spark pubvana:rollback <filename>.
Details
What a Backup Contains
Each backup is a zip archive containing:
- All site files:
app/,public/,vendor/,themes/,widgets/,plugins/, and the project root. - A gzipped MySQL database dump (
database.sql.gz) of all Pubvana tables. - A metadata file (
backup-meta.json) with version, trigger, timestamp, and PHP/MySQL versions.
Backups are stored in writable/backups/ with timestamped filenames in the format YYYY-MM-DD_HHmmss-full.zip.
Backup Retention
Pubvana keeps a maximum of 15 backups. When a new backup is created and the limit is exceeded, the oldest backup is deleted automatically.
Creating a Backup
From the admin UI: Admin → Backups → Create Backup. Progress is displayed in real time via SSE.
From the CLI:
php spark pubvana:backup --trigger=manual
Automatic backups are created before every CMS update and before every rollback. These are labelled with --trigger=pre-update or --trigger=pre-rollback.
Downloading a Backup
On the Backups page, click Download next to any backup to download the zip file to your local machine. Store copies offsite for disaster recovery.
Restoring from a Backup
From the admin UI: Admin → Backups → click Restore next to the backup you want to use. Pubvana will:
- Create a safety backup of the current state (labelled
pre-rollback). - Extract the selected backup zip.
- Restore all files to their backed-up state.
- Import the database dump, replacing the current database contents.
- Clear all caches.
From the CLI:
php spark pubvana:rollback 2026-03-29_143022-full.zip
The argument is just the filename — the file must exist in writable/backups/. Backup filenames are validated with a strict regex (YYYY-MM-DD_HHmmss-full.zip) to prevent path traversal attacks.
What Is Preserved During Restore
During a restore, Pubvana preserves the .env file from the current installation (not the backup). This prevents overwriting database credentials and environment settings with those from the backup environment.