Skip to content

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 ​

WhatHoldsHow often
The databaseEvery record, entity, field, user and settingDaily, and before every update
storage/app/Uploaded files and imagesWith the database
.envThe database password and the application keyOnce, 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 .env

For PostgreSQL:

bash
pg_dump -U crm -Fc crm > qorekit-$(date +%F).dump

Restoring ​

  1. Upload the same version of Qorekit, or the version the backup was made with.
  2. Put back .env and storage/app/.
  3. Import the database dump into an empty database.
  4. 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.

Qorekit is free software under the GNU GPL, version 3 or later.