Using this instruction you can easily schedule the automatic backup of a MySQL or MariaDB database.
Follow the below steps:-

Create environment:-

Log into the GPUonCLOUD Manager

Click Create environment.



In the Environment topology dialog pick MySQL as a database you want to use. Then set the cloudlet limit, state the environment name and click Create.



Wait just a minute for your environment to be created.

 

Check your e-mail – your inbox should have a message from Robot@gpuoncloud with database login and password.




Setting up backups:-


Click
the Config button next to your database.


In the opened configuration tab open MySQL file in the cron folder.

In the opened file you’ll see three samples of the cron parameters configurations:

        • for backup of several DBs (if you created them through the db admin panel):

#0 1 * * * /var/lib/gpuoncloud/bin/backup_script.sh -m dump -u USER -p PASSWORD -d db1[,db2,db3….]

        • for separate DB tables backup:

#0 2 * * * /var/lib/gpuoncloud/bin/backup_script.sh -m dump -u USER -p PASSWORD -d db -t table1[,table2,table3….]

        • for the whole DB backup:

#0 3 * * * /var/lib/gpuoncloud/bin/backup_script.sh -m dumpall -u USER -p PASSWORD

Choose the one you need and specify your custom configurations:

  • The frequency of the script evoking (using cron settings);

  • The path to the default script (available for MariaDB and MySQL) or to your own (you can upload it to the scripts folder): /var/lib/gpuoncloud/bin/{script_name}

  • Your database username and password (you received them in the email after adding a database to the environment);

  • If you want to backup several databases or some separate tables, then enter their names separated by a comma

 

For example, if you want to backup your database every 10 minutes with a help of the default script, then the string can be as following:

*/10 * * * * /var/lib/gpuoncloud/bin/backup_script.sh -m dumpall -u root -p GGddHYJ

      • Save your settings!

Checking backups:-

      • Wait the time of backup you’ve scheduled while setting.

      • Navigate to Configuration tab and open backup folder (/var/lib/gpuoncloud/backup). There .bz2 files with all executed backups are stored.



Download Backup:-


           

      • Connect to the MySQL/MariaDB database using any FTP client (e.g. FileZilla) and download your backup .bz2 file.

          


Restore Database

      • Access phpMyAdmin with the credentials you’ve got after adding DB node.

      • Navigate to the Import tab and browse the backup .bz2 file. Click Go.


            

      • When the import is successfully finished you will see your database with all the data restored.

                   

That’s all! Now you can be sure that all your data is being saved periodically and can be restored or reused.