Scaleforce provides an easy and quick process of a database storing for all certified database stacks, along with the respective script. As mentioned, the process is quite easy, which means that you don't need any special to execute it, just follow the setup steps to configure the appropriate cron expression, as described in this article.
Moreover, you will find information on how you can work with the created backups like:
- Check Backup
- Download Backup
- Restore Database
For this tutorial, we will use a MySQL database example, although the same steps may apply to all the other databases.
Backup Scheduling
We are going to use the default backup script to automate the process and configure it according to the specific needs that you may have. If you have an environment without a database yet, please, visit the Database Hosting guide to create one.
1- You can view the source code of the script directly within the dashboard. Click the Config button next to your database to open the built-in file manager and locate the /var/lib/jelastic/bin/backup_script.sh file.
Important!: The backup script is not available for the Redis stack, which is key-value storage, usually used as a cache.
2- We are going to use use the cron scheduler available within the containers out-of-box, to automate the script execution. Open the /var/spool/cron/mysql file and provide a cron expression as shown below:
{frequency} {path-to-script} {script-parameters}
To define the required parameters, you can use the given examples as a template:
- {frequency} - sets the script execution time (see the guide linked above for details), e.g. */10 * * * * to create backup every 10 minutes
- {path-to-script} - points to the required script (default backup script is available at /var/lib/jelastic/bin/backup_script.sh)
- {script-parameters} - provides custom parameters for the defined script; in our case:
-
-m {mode} - to backup whole or part of the database ("-m dumpall" or "-m dump" respectively)
-
-c {count} - to set the number of the old backups to keep (e.g. "-c 3" to keep 3 old backups alongside the most recent one)
-
-u {user} and -p {password} - to provide access credentials for your database (can be found in the after-creation email)
-
-d {databases} and -t {tables} - to optionally specify list of databases ("-d db1[,db2,db3….]") or tables within a database ("-d db -t table1[,table2,table3….]") to backup
-
Important!: If your {password} contains special characters, it should be included in the double quotation. Also, due to the cron specifics, you need to provide additional escaping for the % symbol by adding a backslash before it, for example -p "passw\\%rd".
3- For example, if you want to perform a backup of the whole database every 10 minutes using the default script, then use the following string:
*/10 * * * * /var/lib/jelastic/bin/backup_script.sh -m dumpall -c 3 -u root -p passw0rd
To apply the settings, click on the Save button.

Important!: Any existing data in the mount point folder will be replaced with the files from the remote directory.
You can also create a custom backup script, to run it from the remote server (database host, user, and password details will be required to establish a connection)
Check Backups
The script to be executed (depends on the configured cron frequency) before navigating to the /var/lib/jelastic/backup folder.
Download Backup
You may choose between various options to download a file from a Scaleforce container like:
The access details can be viewed within the dashboard.
3- Installing an FTP add-on for your database to manage files via FTP.
Important: A public IP address is required for this option. If needed, it will be automatically attached to the node during add-on installation.
You can choose any of the proposed options.
Restore Database
You can easily restore your database from the backups. For our MySQL example, the following steps are required:
1- After creating a DB node, you will receive an email with your credentials. Use those credentials to access phpMyAdmin.
2- Go to the Import tab, tick the Browse your computer option, and use the Choose File button to upload the required backup.
Click Go at the bottom of the page.
3- After the importing will finish successfully, a notification will be shown in the admin panel.
You are all set! By following our guide, your data is periodically saved and you can restore or reuse them at any time if needed.