View Categories

Backups & Restore

3 min read

An Academy & Exam OS installation consists of four parts, plus the website images you upload. Back them up together, because they only work as a set.

WhatWhereWhy
The databaseYour MySQL or MariaDB serverEvery account, question, test, result, setting and page
The private configurationWeb/config/app_local.phpSecurity salt and database credentials. It cannot be regenerated: without it, sessions, stored credentials and the installation cannot be read.
The installation markerWeb/config/installed.phpVersion, installation identifier and mode
Private storageWeb/storage/Uploaded media, the installation’s encryption keys and, for Single Site and Multi Site, the licence activation files
Website imagesWeb/webroot/images/user-*The copies of the logo, homepage slide and blog images you uploaded in Website & CMS. The public website serves these copies, and they are not recreated automatically.

The other application files (src/, templates/, vendor/, the rest of webroot/ …) come from the package and do not need a backup — unless you customised them. If you did, back up your changes as well.

How to back up #

  1. Dump the database with your hosting panel’s backup feature or with mysqldump (on MariaDB, mariadb-dump, which takes the same options). See the example command below.
  2. Copy Web/config/app_local.php, Web/config/installed.php, the whole Web/storage/ folder and the Web/webroot/images/user-* files.
  3. Store the set in a location that is not inside the website folder and not on the same disk as the site.

Example database dump (replace academy with your database name):

mysqldump --single-transaction --routines --triggers academy > academy.sql

Daily backups kept for at least two weeks are a sensible default. Take an extra backup immediately before every update.

Important: The backup contains your database password and encryption keys. Store it as securely as the site itself.

How to restore #

  1. Upload the same package version to the target host and set up the folders as in Installing Academy & Exam OS, but do not run the installer.
  2. Restore the database dump into an empty database.
  3. Restore Web/config/app_local.php (adjust the database credentials and the site address if they changed), Web/config/installed.php, Web/storage/ and the Web/webroot/images/user-* files.
  4. Make Web/tmp/, Web/logs/, Web/storage/ and Web/webroot/images/ writable again.
  5. Open the site. It starts directly with the restored data; the installation marker keeps /install locked.

Single Site and Multi Site: if the host name changed, deactivate the licence on the old host before activating it on the new one. See Licence Activation & Deactivation.

Test your backups #

Restore a backup into a test host or a local environment at least once after setting it up, and sign in. A backup that has never been restored is not a proven backup.

Related documents #

Watch the Video Tutorial #

This topic is also covered in Academy & Exam OS Video Tutorial 12: Updates, Backups, Security & Support (watch on YouTube). All Academy & Exam OS video tutorials.