How to back up Salon Booking OS
1 min read
A backup of Salon Booking OS by OsDotâ„¢ is the database and these files of the Web/ directory, taken together:
Video tutorial #
How to back up and update Salon Booking OS by OsDotâ„¢ 1.0.0
| What | Why it matters |
|---|---|
| the database | every account, booking, order, page and setting |
config/app_local.php | the database connection and the site’s security salt. The salt signs sessions and links and keys the stored hashes (for example the list of addresses that asked to receive no messages): without the same salt a restored site cannot read them |
config/installed.php | the installation marker; without it the site offers its installer again |
the whole storage/ directory | the key that encrypts the saved provider settings (storage/keys/), the logs, the installer’s records and the private files |
storage/private/ (inside storage/) and webroot/media/ | the uploaded originals and the public picture files made from them (php bin/cake.php media republish can make the public files again from the originals) |
The update screen and php bin/cake.php upgrade check print the same list as the backup reminder, and an update waits until you confirm that a backup was taken (see Installation: installing an update).
How often #
- Daily: the database and
storage/. Keep several days, and at least one copy away from the server. - After every change of settings or a new provider key:
config/app_local.phpandstorage/keys/together. - Before every update: everything above.
Most hosting panels schedule database dumps and file copies; any tool that makes a consistent mysqldump (or MariaDB mariadb-dump) with triggers and routines works:
mysqldump --single-transaction --routines --triggers --default-character-set=utf8mb4 -u <user> -p <database> > site-YYYY-MM-DD.sql
tar -czf site-files-YYYY-MM-DD.tar.gz config/app_local.php config/installed.php storageRestoring #
- Put the site into maintenance: create
storage/maintenance.flag(see Scheduled tasks). - Restore the database from the dump into an empty database with the same name, user and privileges (or update the connection in
config/app_local.php). - Restore
config/app_local.php,config/installed.phpand the wholestorage/directory from the same backup as the database. - Run
php bin/cake.php upgrade check: it must report the installed version and no pending migrations for the files on disk. - Remove
storage/maintenance.flagand sign in.
A database restored without its own config/app_local.php and storage/keys/ cannot use what they protect: the saved provider settings can no longer be read (enter them again on their settings pages), and what the salt keyed or signed no longer matches.
Keep backups as private as the site itself: they contain personal data and the keys above.