Manual Database Backups

Manual Database Backups

Certified database stacks include a ready-to-use backup script. Configure it through cron to create database backups automatically, control retention, save selected databases or tables, download archives, and restore data when required.

Backups Scheduling

1

Open the backup script

Click Config beside the database node and open /var/lib/jelastic/bin/backup_script.sh.

Database backup script
Open the default backup script in the configuration manager.
i

Redis exception

The default backup script is not available for the Redis stack.

2

Open the database cron file

Open /var/spool/cron/mysql and add a command in this format:

{frequency} {path-to-script} {script-parameters}
Database cron configuration
Configure automatic execution in the database cron file.

Backup Script Parameters

{frequency}Cron schedule, for example */10 * * * * for execution every ten minutes.
-m dumpallBacks up the complete database server content.
-m dumpBacks up only the specified database content.
-c {count}Sets the number of old backups to retain alongside the newest backup.
-u / -pSupplies the database username and password.
-d {databases}Specifies one or more databases.
-t {tables}Specifies selected tables inside a database.
!

Special characters in passwords

Wrap a password containing special characters in double quotation marks. Escape a percent sign for cron with a backslash, for example -p "passw\%rd".

Example: back up everything every ten minutes and retain three old backups:

*/10 * * * * /var/lib/jelastic/bin/backup_script.sh -m dumpall -c 3 -u root -p passw0rd
Database backup cron expression
Add the backup command and save the cron configuration.

Store Backups on Another Node or Server

Configure a mount point for the database backup directory when backups should be stored on another node or remote server. Existing files in the mount-point folder are replaced by files from the remote directory. A custom script can also run from a remote server when it has the database host and credentials.

Store backups on a remote server
Use a mount point to store backups on another node or remote server.

Check Backups

After the cron task runs, open /var/lib/jelastic/backup. A successful operation creates a .bz2 archive in this directory.

Check database backup files
Successful backups appear as bz2 archives.

Download a Backup

DashboardOpen the configuration-file manager, hover over the archive, and select Download.
SFTP or FISHConnect using the access details shown in the dashboard.
FTP add-onInstall the FTP add-on. A public IP is required and can be attached automatically during installation.
Download backups from the dashboard
Download a backup through the configuration-file manager.
Download backups using SFTP or FISH
Use SFTP or FISH with the access details shown in the dashboard.
FTP add-on for backup download
Install the FTP add-on when FTP-based access is required.

Restore a Database

1

Open the database administration panel

For the MySQL example, open phpMyAdmin and sign in with the credentials supplied after database creation.

Database credentials email
Use the database credentials supplied after node creation.
2

Import the archive

Open the Import tab, choose the required backup file, and click Go.

Import a database backup
Upload the backup through the database administration panel.
3

Confirm restoration

Wait for the administration panel to display the successful import notification.

Database restored successfully
The administration panel confirms successful restoration.

Expected Result

The selected database data is backed up automatically according to the cron schedule, retained according to the configured count, stored locally or remotely, and available for download or restoration.

Important Notes

  • The guide uses MySQL as the example, but the workflow is similar for other certified database stacks.
  • The default backup script is not available for Redis.
  • Protect credentials stored in cron configuration.
  • Verify backup archives regularly instead of relying only on task execution.
  • Test the restoration procedure before a production emergency.
  • Use remote storage to reduce the risk of losing backups with the database node.

Common Issues and Solutions