Backups and restore
Create, download and restore a backup, and schedule them daily.
What a backup contains
A backup is a single archive with:
- a SQL dump of the database (events, orders, tickets, settings),
storage/app— posters, uploaded files, generated tickets,.env, so the configuration can be inspected later.
.env is stored but never restored automatically: overwriting production credentials from an old archive is a good way to break a working site.
Creating one
Admin → Backups → Create backup. The dump runs in a single transaction, so the database is consistent even while tickets are being sold.
Each row in the list shows the size and the creation date, and offers Download and Delete.
Restoring
Restore asks for confirmation, then:
- takes a fresh backup of the current state — the "before restore" archive,
- wipes the live schema,
- imports the chosen dump,
- copies the files back.
The wipe matters. A dump only drops the tables it contains, so without it tables created after the backup would survive the restore and break the next migration. The app handles this automatically; the note is here because it explains why the process takes a moment.
Restoring from your own archive
Upload backup accepts an archive created by this product on another installation — for example, a copy of production brought to a staging server.
The same confirmation and the same pre-restore backup apply.
Scheduling
Two commands run on a schedule out of the box:
// routes/console.php
Schedule::command('backup:run')->dailyAt('03:00');
Schedule::command('backup:clean')->dailyAt('03:40');
They need a cron entry calling the scheduler once a minute:
* * * * * cd /var/www/tickets && php artisan schedule:run >> /dev/null 2>&1
Run it as the web server user so the files land with the right owner:
* * * * * sudo -u www-data php /var/www/tickets/artisan schedule:run
Retention
backup:clean removes archives older than the retention window configured in config/backup.php. The default keeps a week of dailies; raise it if your ticket history is the only copy of something that matters.
Where the files live
storage/backups, outside storage/app, so a backup never ends up inside the next backup. The path is a disk in config/filesystems.php; point it at S3 or another volume if the server's disk is small.
A backup is not a plan
Restoring a dump is only useful if someone has tried it. Once a quarter, restore yesterday's archive on a staging copy and open the storefront. It takes ten minutes and it is the difference between a backup and a hope.
If mysqldump is missing
The dump uses the mysqldump binary. When the web server cannot find it, set the directory explicitly in .env:
DB_DUMP_BINARY_PATH=/usr/bin
Not the path to the binary — the directory that contains it.
Not covered here?
Write to sales@scenecms.com — we answer within one business day.