Skip to main content

Creating a MariaDB Backup Set for Linux


There are two options to create a MariaDB Database Backup Set for Linux.

  • Using AhsayCBS web console

    For backup set creation on AhsayCBS web console, most backup set preferences may be configured using AhsayCBS except the following:

    • backup set encryption key settings
    • MariaDB login password

    After the backup set preferences are setup on the AhsayCBS web console, to complete the backup set creation process the RunConfigurator.sh script will need to be used on the MariaDB machine to do the following:

    • to setup the backup set encryption key settings
    • to export/import the backupSet.xml file to setup the MariaDB login password
  • Using command line

    For backup set creation using command line, most backup set preferences may be configured using the backupSet.xml file.

    To complete the backup set creation process after successfully importing the backupSet.xml file, the RunConfigurator.sh script will need to be used on the MariaDB machine to setup the backup set encryption key settings.


Using AhsayCBS Web Console

  1. Login to AhsayCBS.

    success

  2. Go to User.

    success

  3. Go to Backup Set then click the "+" button to create a backup set.

    success

  4. Input a name, select the “Backup set type” which should be MariaDB Backup and “Platform” which should be Linux. Update the “Host” and “Port”. Default settings for these are localhost and 3306 respectively. Input the “Path to mysqldump” then click the right arrow to proceed.

    success

  5. Add the backup source in the “Other Selected Source” by clicking the "+" button e.g. path is MariaDB/collection.

    success

    To backup all databases in the MariaDB machine, use the path MariaDB.

    success

    Input the path of the source to be backed up. Click the + button to add the source. Keep doing this until all the backup source are added.

    success

    To exclude a source, you can add it under "Deselected Source" by clicking the "+" button.

    success

    Always add the “information_schema” and “performance_schema” databases under “Deselected Source” since they are MariaDB virtual system databases. They are read-only and cannot be backed up.

    Input the path of the source to be excluded in the backup. Click the "+" button to add the deselected source. Keep doing this until all source to be excluded are added. Click the "right arrow" button to proceed.

    success

  6. The “Run scheduled backup for this backup set” is turned on by default. If you do not want to create a backup schedule you can turn it off by sliding the lever to the left. This schedule may either be edited or deleted if you want to create your own backup schedule.

    success

    It is optional to input the computer name in the “Run scheduled backup on computers named” field since it will be updated once backup set creation is completed in the AhsayOBM client. In Step 12 the computer name can be checked as the Owner.

    Click the "+" to add a new schedule or double click on the existing scheudle to change the values. Click the right arrow button to proceed.

    success

  7. Select the “Backup Mode” if Concurrent or Sequential. By default, Sequential is selected. In Sequential backup mode, if there are multiple destinations configured in the backup set, AhsayOBM will backup to one destination at a time. In Concurrent backup mode, if there are multiple destinations configured in the backup set, AhsayOBM will backup to all destinations at the same time or concurrently.

    success

    For backup sets with multiple destinations, sequential backup mode will take longer compared with concurrent backup mode.

    If Concurrent is selected, specify the maximum number of backup destinations.

    success

    Click the "+" button to add the standard or predefined destinations.

    success

    Select your desired destination, it could be one or both displayed destinations. Tick, the checkbox and click the "+" to proceed. Click the right arrow afterwards.

    success

  8. Click the Save button to create the backup set.

    success

  9. Click on the backup set you just created.

    success

    Go to Others and input the path of your temporary directory. It is recommended to check the box beside Remove temporary files after backup to make sure the spooled database files are cleaned up after each backup job to free up space on the temporary drive. Otherwise, if the temporary drive runs out of space the database backup job will not run.

    You can also change the settings for the Compressions. Click the "save" icon once done.

    success

  10. Open ssh session in the Linux machine and execute the RunConfigurator.sh script. The “Login Menu” will be displayed. Select (1). Login then press Enter to login. Input your “Login Name” and “Password”. Set the encryption setting for the backup set.

    
    # cd /usr/local/obm/bin
    # sh RunConfigurator.sh
    Startup Ahsay Online Backup Manager ...
    Config file found
    Login Menu
    ----------
    (1). Login
    (2). Change Network Settings
    (3). Forgot Password
    (4). Quit
    ----------
    Your Choice: 1
    Login Name : test
    Password : *******************
    Please wait while verifying user account with server...
    Your profile has been downloaded and updated.
    Encryption setting has not been defined for backup set "MariaDB Database Backup
    Set 1"
    Do you want to set the encryption setting for this backup set? (Y/N) ? Y
    Enable Encryption (Y/N) ? Y
    Choose Encryption Type
    ----------------------
    (1). Default
    (2). User password
    (3). Custom
    ----------------------
    Your Choice: 2
    
  11. . Edit the backup set created from AhsayCBS to add the MariaDB Password. Select (1). List Backup Sets to list the backup set.

    
    Main Menu
    ---------
     (1). List Backup Sets
     (2). Delete Backup Set
     (3). Export Backup Set Settings to XML
     (4). Import Backup Set Settings from XML
     (5). Generate new Backup Set Settings Template
     (6). Change Language [English]
     (7). Update Profile Settings
     (8). Quit
    ---------
    Your Choice: 1
    
  12. Select the backup set to show the details by selecting (1). Name of your backup set

    
    Select a Backup Set to show more details
    ----------------------------------------
     (1). MariaDB Database Backup Set
     (2). MariaDB Database Backup Set 1
    ----------------------------------------
    Your Choice:
    Name : MariaDB Database Backup Set 1
    Owner : localhost.localdomain
    Type : MariaDB
    Selected Source : MariaDB/collection
    Selected Source : MariaDB/test
    Deselected Source : MariaDB/information_schema
    Deselected Source : MariaDB/performance_schema
    Destination Name : AhsayCBS, Type: OBS
    Encryption Key : 123
    Encryption Algorithm : AES
    Encryption Mode : CBC
    Encryption Key Length: 256
    Press Enter to continue...
    
  13. Export the backup set to XML by selecting (3). Export Backup Set Setting to XML

    
    Main Menu
    ---------
     (1). List Backup Sets
     (2). Delete Backup Set
     (3). Export Backup Set Settings to XML
     (4). Import Backup Set Settings from XML
     (5). Generate new Backup Set Settings Template
     (6). Change Language [English]
     (7). Update Profile Settings
     (8). Quit
    ---------
    Your Choice: 3
    Choose your backup set to generate XML file
    -------------------------------------------
     (1). MariaDB Database Backup Set
     (2). MariaDB Database Backup Set 1
    -------------------------------------------
    Your Choice: 2
    XML file successfully exported to /root/.obm/config/backupSet.xml
    
  14. Exit from the Main Menu then edit the XML file by using an editor like vi. Add the “Value data” for “MariaDB Password” to the file then save.

    
    # cd /root/.obm/config
    # vi backupSet.xml
    >!-- MariaDB Password --<
     >Value data="abc123$%" name="Password" type="string" /<
    

    Please refer to Troubleshooting - Backup Set XML Template (With Explanation) for details on the fields to be configured.

  15. Import the backup set by selecting (4). Import Backup Set Setting from XML. Confirm overwrite of file.

    
    Main Menu
    ---------
     (1). List Backup Sets
     (2). Delete Backup Set
     (3). Export Backup Set Settings to XML
     (4). Import Backup Set Settings from XML
     (5). Generate new Backup Set Settings Template
     (6). Change Language [English]
     (7). Update Profile Settings
     (8). Quit
    ---------
    Your Choice: 4
    Backup Set 'MariaDB Database Backup Set 1' already exist. Confirm
    overwrite? (Y/N) ? Y
    XML imported, uploading to server...
    XML successfully uploaded to server
    
  16. Check in AhsayCBS web console if MariaDB Password and Encryption setting was successfully added.

    success

    success


Using Command Line

  1. To create a MariaDB database backup set, select (5). Generate new Backup Set Settings Template from the menu.

    
    Main Menu
    ---------
     (1). List Backup Sets
     (2). Delete Backup Set
     (3). Export Backup Set Settings to XML
     (4). Import Backup Set Settings from XML
     (5). Generate new Backup Set Settings Template
     (6). Change Language [English]
     (7). Update Profile Settings
     (8). Quit
    ---------
    Your Choice: 5
            
  2. Select (3). MariaDB to generate a MariaDB Database backup set template file to /root/.obm/config directory.

    
    Choose a template from a backup set type
    ----------------------------------------
     (1). File
     (2). MySQL Database
     (3). MariaDB
     (4). Oracle Database Server
     (5). IBM Domino
    ----------------------------------------
    Your Choice: 3
    XML file successfully exported to
    /root/.obm/config/backupSet.xml
    Main Menu
    ---------
     (1). List Backup Sets
     (2). Delete Backup Set
     (3). Export Backup Set Settings to XML
     (4). Import Backup Set Settings from XML
     (5). Generate new Backup Set Settings Template
     (6). Change Language [English]
     (7). Update Profile Settings
     (8). Quit
    ---------
    Your Choice:
    
  3. Configuring MariaDB Backup Set Settings

    To configure the MariaDB backup set setting you need to edit the /root/.obm/config/backupSet.xml file using a text editor, for example vi.

    You can either quit the RunConfigurator.sh script or open a new ssh session to edit the backupSet.xml file.

    • Before importing the backupSet.xml file please remove any unused destinations and backup schedule settings. Otherwise, the following error will be displayed “Failed to import XML file (Reason: Value of name is empty!)” when trying to import the backupSet.xml file.
    • Setup of the following cloud storage destinations: OneDrive, OneDrive for Business, DropBox and Google Drive are not supported in Linux CLI environment, as these cloud storage destinations require authentication using a web browser.
  4. Importing the updated backupSet.xml file to AhsayOBM

    After you have edited the backupSet.xml file with your chosen backup settings you need to import the settings back to AhsayOBM, so they can be uploaded to AhsayCBS backup server to create the backup set.

    For example: to create a new MariaDB backup set called “MariaDB Database 2” with encryption enabled and default encryption settings.

    
    Main Menu
    ---------
     (1). List Backup Sets
     (2). Delete Backup Set
     (3). Export Backup Set Settings to XML
     (4). Import Backup Set Settings from XML
     (5). Generate new Backup Set Settings Template
     (6). Change Language [English]
     (7). Update Profile Settings
     (8). Quit
    ---------
    Your Choice: 4
    Reading xml...
    Reading xml...Done
    Verifying destination 'AhsayCBS'...
    New backup set created.
    Enable Encryption (Y/N) ? y
    Choose Encryption Type
    ----------------------
     (1). Default
     (2). User password
     (3). Custom
    ----------------------
    Your Choice: 1
    XML imported, uploading to server...
    XML successfully uploaded to server
            
  5. Verify the Backup Set Settings

    To verify the uploaded backup set settings are correct select (1). List Backup Sets and then select the backup you wish to verify, for example backup set named “MariaDB Database 2”.

    
    Main Menu
    ---------
     (1). List Backup Sets
     (2). Delete Backup Set
     (3). Export Backup Set Settings to XML
     (4). Import Backup Set Settings from XML
     (5). Generate new Backup Set Settings Template
     (6). Change Language [English]
     (7). Update Profile Settings
     (8). Quit
    ---------
    Your Choice: 1
    Select a Backup Set to show more details
    ----------------------------------------
     (1). MariaDB Database
     (2) MariaDB Database 1
     (3) MariaDB Database 2
    ----------------------------------------
    Your Choice: 3
    Name : MariaDB Database 2
    Owner : localhost.localdomain
    Type : MariaDB
    Selected Source : MariaDB/collection
    Selected Source : MariaDB/test
    Deselected Source : MariaDB/information_schema
    Deselected Source : MariaDB/performance_schema
    Destination Name : AhsayCBS, Type: OBS
    Encryption Key : 123
    Encryption Algorithm : AES
    Encryption Mode : CBC
    Encryption Key Length: 256
    Press Enter to continue...
            
    • We would like to stress that it is very important to keep a separate record of your encryption key in a safe place, as you will not be able to restore your data without the correct key.
    • If you re-install AhsayOBM or install AhsayOBM on another machine, the encryption key will be required for restoring data from the backup set.