You can prepare in advance to recover the database of DB instance in case of failure. You can perform backups through the console whenever necessary, and you can configure to perform backups periodically. During backup, storage performance of the DB instance on which the backup is performed can be degraded. To avoid affecting service, it is better to perform back up at a time when the service is under low load. If you do not want the backup to degrade performance, you can use a high-availability configuration or back up only increments of data since the previous backup, or perform backups from read replica.
[Note] High availability DB instances perform backups on the redundant master so that the storage performance of the master is not degraded. However, backups can be performed on the master even if it is a high availability DB instance in the following cases. * If a backup cannot be performed due to a candidate master failure. * If you do not have a read replica in a situation where you need a backup taken from a DB instance other than the candidate master for rebuilding the candidate master and you do not have a read replica
Backups can be categorized into manual and automa backups.
You can perform a manual backup from the console to permanently save a database at a specific point in time. Unlike auto backups, manual backups are not deleted when the DB instance is deleted, unless you explicitly delete the backup. When creating a manual backup, you must specify a name for the backup, with the following limitations. * Backup name has to be unique for each region. * Backup names are alphabetic, numeric, and - _ between 1 and 100 Only, and the first character has to be an alphabet.
Create a manual full backup
❶ You can create a full backup manually by selecting the DB instance to back up from the DB instances list and clicking Backup. ❷ You can create a full backup manually by clicking Create Full Backup in the backup list and specifying the DB instances to back up.
Create a Manual Incremental Backup
❸ You can create an incremental backup by selecting a baseline backup from the backup list and then clicking Create incremental backup. Some backups cannot be selected as a baseline backup; for a detailed description of baseline backups, see Baseline backups.
In addition to performing backups manually, auto backups can occur when required for restore operations or based on auto backup schedule settings. For settings that apply during auto backups, see Auto Backup Settings.
Full and incremental backups are available.
Backs up all data in the DB instance.
Incremental backups only back up data changes since the baseline backup was performed. Recommended if your data is mostly immutable. Incremental backups are always performed on the DB instance that performed the baseline backup. When restoring to an incremental backup, the restore proceeds from the first full backup created, and all increments are reflected sequentially until the selected incremental backup is reached.
[Caution] Restoring from incremental backups may take more time than restoring from a full backup, which is proportional to the sum of the capacity of the incremental backups required for the restore.
Incremental backups require a backup to baseline data changes on. An incremental backup can also be the baseline backup for a new incremental backup.
The following limitations exist for backups that are the basis for incremental backups. They are common to both manual and auto incremental backups. * A backup in an error state cannot be a baseline backup. * A backup created before the last failover cannot be the baseline backup. * A backup created before the last DB Engine version upgrade cannot be a baseline backup. * If an incremental backup already exists that is based on that backup, it cannot be the baseline backup. However, if the previous increment failed, you can increment based on the same backup. * If the DB instance that took that backup has been deleted or is unable to take a backup due to failure, it cannot be the baseline backup. * Backups created before the September 2024 scheduled release cannot be baseline backups.
When incremental backups are scheduled according to Auto Backup Schedule Strategy, a baseline backup that satisfies the above constraints, plus the following additional constraints, is automatically selected. If no baseline backup satisfies the constraints, a full backup is performed regardless of the auto backup schedule strategy. * A backup performed on a candidate master, read replica that is in a replication down state cannot be a baseline backup. * A backup performed without table locks enabled cannot be a baseline backup. * If a new full backup was created after that backup was created, it cannot be the baseline backup.
When creating and modifying DB instances, you can specify settings that will be applied to backups.
The following topics are common to both auto and manual backups.
Use Table Lock
FLUSH TABLES WITH READ LOCK
ets whether the syntax is enabled or disabled.FLUSH TABLES WITH READ LOCK
syntax periodically during backups to ensure consistency in backup data. If FLUSH TABLES WITH READ LOCK
syntax fails to run, the backup will fail.FLUSH TABLES WITH READ LOCK
syntax will not run, so a high DML load does not cause the backup to fail. However, backups without table lock may not ensure consistency of backup data, and as a result, some operations, including restore and replication processes, are not supported for backups created without table lock and for DB instances with table locking disabled.Query Latency Dash Time (second)
FLUSH TABLES WITH READ LOCK
syntax. FLUSH TABLES WITH READ LOCK
syntax will wait for the query latency dash time. It can be set from 0 to 21,600 seconds. Longer settings reduce the likelihood of backup failures due to DML query load, but may result in longer overall backup times.The following items apply only to auto backups.
Allow Auto Backup
Auto Backup Retention Period
[Caution] Incrementally created backups are deleted when the baseline backup is deleted, even if the auto backup retention period has not passed.
Auto Backup Replication Region
Number of Auto Backup Retries
Use Auto Backup Schedule
Auto Backup Schedule Strategy
All Data Backup Days
Auto Backup Run Time
[Caution] A backup might not be performed in some situations, such as when a previous backup does not terminate. If no incremental baseline backup exists, a full backup might be performed even though it is the scheduled turn to perform an incremental backup. For a detailed description of incremental baseline backups, see Baseline Backup.
All backup files are uploaded to the internal backup storage and stored. For manual backups, they are stored permanently until you delete them separately, and backup storage charges are incurred depending on the backup capacity. For auto backups, it is stored for the set retention period and charges for the full size of the auto backup file, which exceeds the storage size of the DB instance. If you do not have direct access to the internal backup storage where the backup file is stored, and when you need backup file, you can export the backup file to the object storage in NHN Cloud.
After a backup, you can export the backup file to user object storage. This is not supported for incremental backups.
❶ Select the DB instance to back up and click Export backup files to object storage after backup from the drop-down menu, and the settings pop-up screen will appear. ❷ Enter the tenant ID of the object storage where the backup will be saved. You can find the tenant ID in the API endpoint settings. ❸ Enter the NHN Cloud member or IAM member of the object storage where the backup will be saved. ❹ Enter the API password of the object storage where the backup will be saved. ❺ Enter the container of the object storage where the backup will be saved. ❻ Enter the path to the backup that will be stored in the container. The folder name can be up to 255 bytes, and the full path can be up to 1024 bytes. Certain forms (. or ..) are not allowed, and special characters (' " < > ;) and spaces are not allowed.
You can export backup files stored in internal backup storage to user object storage. Not supported for incremental backups.
❶ On the Details tab of the source DB instance from which the backup was taken, select the backup file to export and click Export Backup to Object Storage, and a pop-up screen will appear to export the backup.
❷ Select the backup file to export from the Backup tab and click Export to Object Storage.
[Note] For manual backups, if the source DB instance that performed the backup was deleted, you cannot export the backup.
Backups allow you to restore data to any point in time. Restoration always creates new DB instance and cannot be restored to the existing DB instance. You can restore only to the same DB engine version as the source DB instance from which you performed the backup. Supports restoring snapshots to the point in time when the backup was created, and restoring point in time to a specific point in time. You can restore it as backup of external MariaDB as well as backup that you created in RDS for MariaDB.
[Caution] Restoration might fail if the data storage size of the DB instance that you want to restore is smaller than the data storage size of the source DB instance that you backed up, or if you use a different parameter group than the parameter group of the source DB instance.
You can restore using only the backup file, so you don't need the original DB instance from which the backup was taken. To restore a snapshot from the console,
❶ Select the backup file you want to restore On the details tab of the dB instance, and then click Restore Snapshotto go to the Restore DB instance screen.
Or
❶ On the Backup tab, select the backup file you want to restore, and then click Restore Snapshot.
Restoring to a particular point in time is called point-in-time restoration. You can restore to a specific position in the binary log, as well as to restore to a specific time. Point-in-time restoration requires backup file and binary log from the time you performed the backup to the time you wanted the restore. Binary logs are stored in the storage of the source DB instance where the backup is performed. Shorter binary log retention period allows you to use more storage capacity, but it may be difficult to restore to the desired point in time. For the cases listed below, you may not be able to restore to the desired point in time because there is no binary log required for point-in-time restoration.
To restore a point in time from the console
❶ Select the DB instance you want to restore to a point in time and click + Restore Point-In-Time to go to the page where you can set up a point in time restore.
When restoring with a timestamp, proceed with the restoration based on the backup file closest to the selected point in time, and then applies a binary log up to the desired point in time.
❶ Select a restore method.
❷ Select a restore time. You can restore to the most recent point in time, or you can enter a specific point in time.
❸ Click Confirm the last query to be restored to display a pop-up screen where you can confirm the last query to be restored.
The restore with binary log process first restores to the selected backup file and then applies the binary log to the desired location.
❹ To restore to a binary log, you must first select a backup file. ❺ Select a binary log file. ❻ Enter a specific location for the binary log.
You can use an external MariaDB backup file to create a DB instance.
[Caution] If the setting value of innodb_data_file_path is not ibdata1:12M:autoextend, it is unable to restore to DB instance of RDS for MariaDB.
(1) Use the command below to perform a backup on the server where MariaDB is installed.
mariabackup --defaults-file={my.cnf path} --user {user} --password '{password}' --socket {MariaDB socket file path} --compress --compress-threads=1 --stream=xbstream {directory where create backup file} 2>>{backup log file path} > {backup file path}
(2) Check that completed OK!
is in the last line of the backup log file. If there is no completed OK!
, the backup did not end successfully, so refer to the error message in the log file to proceed with the backup again.
(3) Upload the completed backup file to the object storage.
(4) After accessing the console of the project you want to restore, on the DB Instances tab, click the Restore to Backup in Object Storage button.
You can use the backup file in RDS for MariaDB to restore the database in MariaDB directly. Only full backups can be restored; incremental backup reflection is not supported. When restoring a RDS for MariaDB backup file, refer to the Backup and use the same version as Percona XtraBackup used by RDS for MariaDB.
(1) Export backup of RDS for MariaDB to object storage with reference to the Export Backup.
(2) Download the backup of the object storage to the server on which you want to restore it.
(3) Stop the MariaDB service.
(4) Delete all files in the MariaDB data storage path.
rm -rf {MariaDB data storage path}/*
(5) Unzip and restore the downloaded backup files.
cat {backup file storage path} | xbstream -x -C {MariaDB data storage path}
mariabackup --decompress {MariaDB data storage path}
innobackupex --defaults-file={my.cnf path} --apply-log {MariaDB data storage path}
(6) Delete unnecessary files after unzipping files.
find {MariaDB data storage path } -name "*.qp" -print0 | xargs -0 rm
(7) Start MariaDB service.