Creating System Backup

This article explains why, when, and how to do a Safous system backup.

Disclaimer: Please note that this cannot be done through UI. 

Why do you need to backup App Gateways?  

First and foremost, Safous backs up automatically before each upgrade event. Nevertheless, as with any other IT system, we’d recommend that you back up your App Gateway daily. Scheduling and timing of App Gateway backups are within your control.

How many old backups should be kept? 

We recommend the last daily backup be maintained to reduce your storage needs. It largely depends on the number of users you have, their usage, and the retention of the logs. We can estimate that with 500 active users with 14 days of log retention, a backup file will take up approximately  ~100MB of storage locally on the App Gateway. Current systems support restores for the backup file only, which means the entire database, but not the metadata such as certificates, licenses, or recordings.

What gets backed up in App Gateway? 

The backup stores all data from the version you last backed up, with the exception of the certificate, licenses, and recordings. The backup will include all configurations in the admin portal.

How to create a system backup?  

Execute the following command on the IDAC: 

a. sudo docker exec -it config_idac_1 tinker backup dump > <file-path> <password>. 

b. Example: sudo docker exec -i config_idac_1 ./idac tinker backup dump /dbdata/appgw.backupfile 123456 --include-recordings=false 

c. The password is used for restoring the backup.  

d. You know that the system has been properly backed up if you have not received any error messages and the backup file is created showing as size value of  >0.

How to restore the backup? 

To restore the backup, you will first need to reinstall the App Gateway software then follow the below instructions:

a. Add two parameters to docker-compose.yml. By default, these are located here /etc/cyolo/config/docker-compose.yml file. 

BACKUP_FILE_PATH: "<BACK FILE PATH>" 

BACKUP_FILE_PASS: "PASSWORD OF THE BACKUP FILE"

b. After adding these two parameters, shut down Docker and reboot it like this: 

docker-compose down 

docker compose up –d 

c. No new updates will be received by the system until docker-compose.yaml is changed back.  

d. To check that the restoration has succeeded, open a browser to the website application to ensure that the application and all the data are there.