Backup

Prev Next

Available in VPC

In Backup, you can view the backup information configured for each DB cluster to safely store data for users using Cloud DB Serverless. Also, when the data is damaged due to a failure, you can perform restoration using the backup file that was in storage.

To use the backup and restoration, it is recommended to first understand the basic execution rules for the backup provided by Cloud DB Serverless. The basic backup execution rules are as follows:

  • Backup execution methods
    • Performed daily, once a day
    • Select between automatic settings and user-defined settings
      • Automatic settings: A random time will be specified when a Cluster is created, and the backup will be performed at a time similar to the time of the first backup.
      • User-defined settings: Backups are performed within 15 minutes from the time selected by the user.
  • Backup file
    • Retention period: Can be stored for up to 30 days according to the user settings.
    • Storage location: A separate data volume.

Backup interface

The basics of using the backup feature are as follows.

serverless_backup01_ko

Component Description
① Menu name Shows the current menu name.
② Basic features Check details for Cloud DB Serverless, refresh the Backup page.
③ Backup list Configured backup settings per DB cluster and settings information
④ Detailed information [Details] button: Navigate to the Backup menu

Check backup settings list

You can check the backup settings list per DB server in operation. To view the backup settings list:

  1. In the VPC environment of the NAVER Cloud Platform console, navigate toMenu > Services > Database > Cloud DB Serverless.
  2. Click the Backup menu.
  3. When the backup settings list appears, check the required information.
    • DBMS: Type of DB that was created.
    • DB Cluster name: DB Cluster name specified by you.
    • Backup retention period: Maximum number of days for the backup file to be stored in data storage
    • Backup start time: Time at which the backup is performed once a day
    • Backup data size: Size of the completed backup file
    • Latest backup date: Date for the latest backup that was performed.
    • View details: Details and restoration of the backup file list created per DB Cluster, saved to Object Storage.

Check backup file list per Cluster

To view the list of backup files created for each Cluster after a backup has been completed:

  1. In the VPC environment of the NAVER Cloud Platform console, navigate toMenu > Services > Database > Cloud DB Serverless.
  2. Click the Backup menu.
  3. Click [Details] from View details of the backup settings row you want to check the details for.
  4. Check the details for the backup file.
    • Backup date: Date that the backup was performed.
    • Backup time: Time at which the backup was performed.
    • Backup Zone: Zone where the backup was performed.
    • Backup data size: Size of the created backup file upon completion of backup (GB)
    • Status: Status of the backup operation

Restore data from console

Cloud DB Serverless provides a service that enables you to restore lost data using backup files and easily and quickly create a DB cluster.

Backup file restoration

You can restore data using the backup file created through automatic backup.
To restore data using the created backup file:

  1. In the VPC environment of the NAVER Cloud Platform console, navigate toMenu > Services > Database > Cloud DB Serverless.
  2. Click the Backup menu.
  3. Click [Details] in the backup settings row you want to restore.
  4. Select the backup file and click [Restore Backup file].
  5. When the Backup file restoration popup window appears, check or enter the required information for restoration.
    serverless_backup03_ko
    • Backup time: Check the backup restoration time
    • VPC: The backup file is restored to the selected VPC, and this value is required for VPC connection settings when creating a new DB cluster.
    • Subnet: The backup file is restored to the selected subnet, and this value is required for subnet connection settings when creating a new DB cluster.
    • Instance specification settings: Enter the minimum and maximum units within the range of 1 to 165. The maximum value cannot be set lower than the minimum value.
    • Auto Scaling policy settings: Select whether to enable the Auto Scaling policy.
      • Replica scaling criteria: Enter threshold values based on either average CPU usage or the average number of connections.
      • Enter the minimum Replica number and maximum Replica number of within the range of 1 to 15.
    • DB cluster name: Enter the name of the new DB cluster.
  6. Click [Restore].
  7. Click the DB Server menu.
  8. Check the status of the DB cluster restoration.
    • Starting: Status in which a DB cluster is being created (restored) using the information entered by the user.
    • Configuring: Status in which the DB cluster is being configured after being created (restored) with the information entered by the user
    • Running: Status in which the creation (restoration) and configuration of the DB cluster has been completed with the information entered by user, and access to the server is available
Caution

The completion of DB cluster restoration may take several minutes to dozens of minutes.

Store in Object Storage

You can store backup files created in Cloud DB Serverless in Object Storage and retain them elsewhere as needed. To save a stored backup file to Object Storage:

Note

Additional fees apply when you subscribe to Object Storage. For more information about Object Storage and its pricing plans, see Services > Storage> Object Storage on the NAVER Cloud Platform portal.

  1. In the VPC environment of the NAVER Cloud Platform console, navigate toMenu > Services > Database > Cloud DB Serverless.
  2. Click the Backup menu.
  3. Click [Details] of the backup settings row for the file you want to save to Object Storage.
  4. Select the backup file and click [Send to Object Storage].
  5. When the Send to Object Storage popup window appears, click and select the bucket you want to save into.
    serverless_backup04_ko.png
  6. Click [Send to Object Storage].
  7. Click [OK].
Caution
  • When sending to Object Storage, bucket unlocking and access control settings must be disabled.
  • Exporting to Object Storage may take several minutes to dozens of minutes to be completed.

Restore backup file using Object Storage

After saving the backup file to NAVER Cloud Platform’s Object Storage, you can restore data to an on-premises MySQL installation. To restore data using a backup file through Object Storage: The description is based on Rocky Linux 8.x–9.x application servers.

1. Prepare the backup file at the Object Storage

  1. Store the backup file to restore to the Object Storage, referring to save to Object Storage.
  2. In the VPC environment of the NAVER Cloud Platform console, navigate to Menu > Services > Storage > Object Storage > Bucket Management, and click the Bucket where the backup file is saved in.
  3. Click the saved backup file, and then navigate to Edit > Permissions management.
  4. Set all sharing items to Public, and click [OK].
  5. From the details of the saved backup file, copy the link in the Link field.

2. Restore the data using the backup file

  1. Access the application server, referring to the Cloud DB Serverless quickstart.

  2. Paste the copied link in the command below, and then run it to download the backup file.

    • Once downloading the backup file is completed, change the Public settings to Private from the permission management of the Object Storage.
    # wget [Link]
    
    -- Examples
    # wget https://kr.beta-object.ncloudstorage.com/test-bk-02/u-40001936-test-kr2-20251230084500.tar.gz
    
    # tar xzf [backup file name]
    
    -- Examples
    # tar xzf u-40001936-test-kr2-20251230084500.tar.gz  
    
  3. Run the following command to set the absolute path of the my.cnf file.

    # MYSQL_CONF=/etc/my.cnf
    
  4. Run the following commands, in order, to specify the path of BACKUP_DIR as the location of a temporary directory.

    # cd ~
    
    # mkdir backup
    
    # cd ./backup/
    
    # BACKUP_DIR=`pwd`
    
  5. Run the following commands, in order, to check if each path has been specified properly.

    # echo $MYSQL_CONF
    
    # echo $BACKUP_DIR
    
  6. Run the following commands, in order, to end MySQL in operation.

    # systemctl stop mysqld
    
  7. Run the following commands in order to check the datadir location in the my.cnf file, then move the directory specified by the datadir variable to the backup folder.

    # grep datadir ${MYSQL_CONF}
    
    # mv [data directory location] ${BACKUP_DIR}
    
    -- Examples
    mv /var/lib/mysql ${BACKUP_DIR}
    
  8. Run the following commands in order to copy the backup files stored in Object Storage to the datadir location.

    # mkdir [data directory pathway]
    
    -- Examples
    # mkdir /var/lib/mysql
    
    # cp -a [backup file pathway] [data directory pathway]
    
    -- Examples
    # cp -a /root/data/* /var/lib/mysql/
    
  9. Enter the following commands, in order, to move to the location of datadir, and then change the datadir permission to mysql.

    # cd [data directory pathway]
    
    -- Examples
    # cd /var/lib/mysql
    
    # chown -R mysql:mysql [data directory path]
    
    -- Examples
    # chown -R mysql:mysql /var/lib/mysql
    
  10. Add the skip-grant-tables syntax under the [mysqld] statement in the my.cnf file.

    # vi /etc/my.cnf
    
    [mysqld]
    skip-grant-tables
    
  11. Run the following commands, in order, to start MySQL and create a new root account.

    • When running create, the ERROR 1396 (HY000): Operation CREATE USER failed for 'root'@'localhost' error may occur. In this case, run the drop user 'root'@'localhost'; command to delete the existing root account, and then run create again.
    # systemctl start mysqld
    
    mysql -u root -p
    
    mysql > flush privileges;
    mysql > create user root@localhost identified by 'password';
    mysql > grant all privileges on *.* to root@localhost with grant option;
    mysql > flush privileges;
    
  12. Delete the skip-grant-tables statement added under the [mysqld] syntax in the my.cnf file, and then run the following command to restart MySQL.

    # systemctl restart mysqld