Backup for Docker installation

Configuration file, embedded database, log files are all saved into CTFreak config folder ./ctfreak-data.

CTFreak offers 2 methods for backing up/restoring his data.

Cold backup

The cold backup allows you, with a momentary service shutdown, to perform a complete backup of CTFreak.

Backup

Start by stopping the CTFreak service/container.

docker compose stop

Make a backup of the CTFreak config folder.

Start the service/container.

docker compose up -d

Restoration

Stop CTFreak service/container.

Replace the CTFreak config folder with the backed up one.

Start CTFreak service/container.

Hot backup

Hot backup is a partial backup, which means that the log and data files of your executions and the configuration file are not taken into account (in fact, only the embedded database is backed up).

However, it has the advantage of not requiring a service shutdown.

If you cannot find a time window where no task is being executed in CTFreak, then a hot backup can be a good compromise.

Backup

To enable hot backup, log in to the UI as an administrator, go to SettingsBackupEdit and complete the form.

Just like with tasks, hot backup can be scheduled using a cron expression.

Restoration

From a fresh installation of CTFreak:

Stop CTFreak service/container.

In the CTFreak config folder:

  • Delete db.sqlite-shm and db.sqlite-wal files.
  • Replace db.sqlite file with the backed up one.

Start CTFreak service/container.