pubvana / backups
Backup and restore for Pubvana CMS (database + files)
0.1.2
2026-05-16 03:14 UTC
Requires
- php: ^8.1
- enlivenapp/flight-csrf: ^0.1
- enlivenapp/flight-school: ^0.3
- enlivenapp/flight-shield: ^0.2
Suggests
- flightphp/runway: Required for CLI backup commands (php runway backups:*)
- pubvana/admin: Admin UI for backup management
README
Pubvana Backups
I noticed folks downloading some of these packages. I'm super grateful, Thank You! I would like to let folks know until this notice disappears I'm doing a lot of breaking changes without worrying about them. Once versions are up around 0.5.x things should settle down.
Backup and restore module for Pubvana CMS.
Requirements
- PHP 8.1+
- Flight School ^0.3
- Flight Shield ^0.2
- Flight CSRF ^0.1
Installation
composer require pubvana/backups
Enable in app/config/config.php:
'plugins' => [ 'pubvana/backups' => [ 'enabled' => true, 'priority' => 50, ], ],
Features
- Full-site zip backups (configurable directories + database dump)
- Restore from any backup with automatic pre/post-rollback snapshots
- Retention policy (configurable max backups, default 15)
- Protected config files never overwritten during restore
- Dual-mode database operations (mysqldump/mysql CLI with pure PHP fallback)
- File-based progress reporting for admin UI polling
- Background execution via runway CLI with synchronous fallback
- Path traversal validation on zip extraction
Flight School config
This package uses Flight School's return-array config format. src/Config/Config.php returns the package defaults as an array, Flight School stores that array under pubvana.backups on $app.
Service
Mapped as $app->backups(). Provides:
- Create - full-site zip (configurable dirs + database dump), with progress callback
- Restore - backup current state, extract, restore files + DB, backup restored state
- List/Delete/Download - manage stored backups
- Retention - automatically removes oldest backups beyond the configured limit
Config
| Key | Default | Description |
|---|---|---|
backup_path |
PROJECT_ROOT . '/backups' |
Directory where backup zips are stored |
max_backups |
15 |
Maximum backups to keep |
backup_dirs |
['app', 'public', 'vendor', 'themes'] |
Directories included in the backup |
protected_configs |
['app/config/config.php', 'app/config/config_sample.php'] |
Files never overwritten during restore |
CLI Commands
php runway backups:create php runway backups:create --trigger pre-update --user admin php runway backups:restore 2026-05-15_221300-full.zip php runway backups:restore 2026-05-15_221300-full.zip --user admin
License
MIT