CLOUD PAAS / DATABASE

Database Backups

This guide has been reviewed and reformatted for Ruk-Com Cloud PaaS. Screens may vary slightly by platform version.

Click or tap a screenshot to view it at its original size.

Objective

This guide explains how to use Database Backups on Ruk-Com Cloud PaaS, with ordered procedures and practical verification points.

Before you begin

  • Sign in with an account permitted to manage the relevant environment.
  • Confirm the target environment, region and resources before saving changes.
  • Create a backup or rollback plan before changing a production system.

Ruk-Com PaaS has providedcertified database stacksAll with convenient and to-the-point scripts for backups. Therefore, this processing is as simple as specifying the required parameters and can be done in just a few minutes. Here it is not necessary to have specialized knowledge. Just follow the installation steps.setup stepsto make appropriate crontab settings.

We will also show you how you can work with creating backups.

for this teaching We will use the database MySQL/MariaDB is an example, however the required steps are similar to other database types in the Ruk-Com Platform.

Scheduling a backup

Use the default backup script to automate the backup creation process and set specific preferences (e.g. backup frequency, number of historical files, etc.) as needed if you don't already have a database environment. Follow the guidelines.Database creationto create

1. The script's source code can be viewed directly from the dashboard. Click on the button.Confignext to the database to open the built-in file manager and search for files./var/lib/jelastic/bin/backup_script.sh

Ruk-Com Cloud PaaS procedure screenshot

Backup scripts are not supported forRedis stackthat is used to store key-values is usually just a caching system or temporary data storage

2.To execute the script automatically, we will use link.cron schedulercontained in the ready-made Container. Open the file./var/spool/cron/mysql and usecron expression according to the following format

Ruk-Com Cloud PaaS procedure screenshot

In the script above, you can see that we have already created an example for each feature. You can remove the Comments to enable the Crontab to work. After that, set up the various sections as follows.

  • {frequency}– Set the time of running the script. (Details can be found in the guidelines link above), such as */10 * * * * to backup data every 10 minutes.
  • {path-to-script}- Point to the desired script. (The default backup script is set to /var/lib/jelastic/bin/backup_script.sh)
  • {script-parameters}– Provide custom parameters for a given script; The following is available in our case:
  • -m {mode}to backup all or part of the database ("-m dumpall" or "-m dump" respectively).
  • -c {count}Specify the number of old backups to store (e.g. "-c 3" to store 3 old backups, e.g. 1 2 3 1 2 3. Files will be overwritten to avoid wasting space.
  • -u {user}and-p {password}Access password for the database (will be sent via email after creating the Env)

If your {password} contains special characters, it should be wrapped with a ". Additionally, due to the specifics of cron, you need to add escaping characters like the % symbol by adding a backslash before it. For example: -p "passw\\%rd"

  • -d {databases}and-t {tables}to specify a selection of databases ("-d db1[,db2,db3…]") or database tables ("-d db -t table1[,table2,table3…]") to back up.

3. Example: If you want to backup all data from a database every 10 minutes with the help of a startup script. Then the string should be like this.

Ruk-Com Cloud PaaS procedure screenshot

Save settings for use.

4.In order to store data on another container node or remote server it can be configured.mount pointappropriate for your database

Ruk-Com Cloud PaaS procedure screenshot

Various information contained in the foldermount pointwill be replaced with files from the remote directory.

Verify backups

Wait for the script to execute. (depending on the configured cron frequency) and go to the folder/var/lib/jelastic/backup 

Ruk-Com Cloud PaaS procedure screenshot

If the backup completes, you will see bz2 stored in the directory.

Download backup

There are various options for downloading files from Ruk-Com Container.

1. In the most direct way is to useconfiguration file managerdirectly in the dashboard

Ruk-Com Cloud PaaS procedure screenshot

Search for the desired file Hover your mouse over the location. and press download from the displayed menu

2.Another option is to use a connection.SFTP/FISH protocol

Ruk-Com Cloud PaaS procedure screenshot

Required access details can be found in the dashboard.

3.It can also be installedFTP add-onFor database to manage files via FTP

public IPaddress is required for this option If necessary, it will automatically connect to the node during the installation of the add-on.

Ruk-Com Cloud PaaS procedure screenshot

You can choose any option. according to your requirements

Database recovery

If necessary You can easily restore a database from a backup. Using our MySQL example, follow these necessary steps:

1. Access the phpMyAdmin panel with the details from the email received after creating the DB Node.

Ruk-Com Cloud PaaS procedure screenshot

2. Go to the Import tab, check the Browse your computer option and use the button.Choose Fileto upload the required backup.

Ruk-Com Cloud PaaS procedure screenshot

Press the Go button at the bottom of the page.

3. When the import is successful. You will see a notification pop up in the admin panel.

Ruk-Com Cloud PaaS procedure screenshot

That's all Now you can rest assured that all your data will be backed up periodically as and when needed. Can be easily recovered or reused