Backups
Qorekit keeps everything in two places: the database and the storage/ folder. Back up both, and keep a copy of .env.
What to back up
| What | Holds | How often |
|---|---|---|
| The database | Every record, entity, field, user and setting | Daily, and before every update |
storage/app/ | Uploaded files and images | With the database |
.env | The database password and the application key | Once, and when it changes |
Without .env a backup still restores, but the application key in it signs sessions: a new key signs everyone out, nothing more.
Keep backups somewhere other than the server itself.
With your hosting panel
Most panels make full account backups (files and databases) on a schedule; check that yours does and how long it keeps them. Before an update, make one by hand:
- DirectAdmin: Create/Restore Backups, or MySQL Management for just the database.
- cPanel: Backup, or phpMyAdmin › Export for just the database.
From the command line
For MySQL or MariaDB:
bash
mysqldump --single-transaction --default-character-set=utf8mb4 -u crm -p crm > qorekit-$(date +%F).sql
tar czf qorekit-files-$(date +%F).tar.gz storage/app .envFor PostgreSQL:
bash
pg_dump -U crm -Fc crm > qorekit-$(date +%F).dumpRestoring
- Upload the same version of Qorekit, or the version the backup was made with.
- Put back
.envandstorage/app/. - Import the database dump into an empty database.
- Open the site. If the backup came from an older version, Qorekit brings the database up to date on the first request.
Because every entity is a real table, a database backup is also readable on its own, with any database tool, even without Qorekit.