Introduction
PostgreSQL data backup is a database backup feature provided by Tencent Cloud Object Storage (COS) based on SCF (Serverless Cloud Function). It helps users archive backup files from PostgreSQL cloud databases to COS for persistent storage to prevent data loss or corruption. After users configure backup function rules in a specified bucket, SCF periodically scans your PostgreSQL backup files and archives the files to the bucket. By default, it archives backup files within 3 days of the trigger time. Note
The PostgreSQL data backup function backs up the backup files of Tencent Cloud PostgreSQL databases. If you have not enabled PostgreSQL database backup previously, you cannot execute the backup function. For more information about Tencent Cloud PostgreSQL database backup, see PostgreSQL automatic backup settings. If you have previously added PostgreSQL data backup rules for a bucket in the COS Console, you can view the created PostgreSQL data backup function in the SCF Console. Please do not delete this function, as it may cause your rules to become ineffective. The current feature is only supported in regions where both COS and SCF are available. Some regions (e.g., Chongqing) are not supported. The actual supported regions are subject to those displayed on the COS and SCF consoles.
The size of a single backup file must not exceed 2TB. Files exceeding this size may cause backup failure.
Operation Steps
Set Up Backup in Application Integration
2. In the left navigation, click Application Integration > Data Backup, and locate PostgreSQL Backup.
3. Click Configure Backup Rules to go to the rule configuration page.
4. Click Add Function.
Note:
If you have not activated the SCF service, please go to the SCF Console to activate it, then complete the service authorization as prompted If you have not activated CLS, please go to the CLS Console to activate the service and complete the activation process by following the prompts 5. In the pop-up window, configure the following information:
Function Name: As the unique identifier of the function, it cannot be modified after creation. You can view this function on the SCF Console. Associated Bucket: The bucket that stores PostgreSQL backup files.
Note:
The region where the PostgreSQL data to be backed up resides must be the same as the region where the associated bucket is located.
Trigger Cycle: The PostgreSQL data backup function triggers the backup and archive operation via a timed trigger. The trigger cycle supports daily and custom intervals.
Cron Expression: When the trigger cycle is set to custom, you can specify the trigger cycle rule via Cron. Cron currently runs on UTC +8 China Standard Time (Beijing Time). For detailed configuration policies, see Cron-related Documentation. Database Instance: The list of PostgreSQL database instances in the region where the bucket is located.
Delivery Path: The prefix of the delivery path for backup files. If left blank, the files will be saved in the root path of the bucket by default.
SCF Authorization: PostgreSQL data backup requires authorizing SCF to read database instances and their backup files from your PostgreSQL backups, and archive the backup files to your specified bucket. Therefore, this authorization needs to be added.
6. After adding the configuration, click Confirm, and you will see that the function has been successfully added.
You can perform the following operations on the newly created function:
Click Log to view the historical operation status of PostgreSQL data backups. When backup errors occur, you can also click Log to quickly navigate to the SCF Console and examine detailed error logs.
Click Details to view detailed information about the function and trigger.
Click More > Edit to modify PostgreSQL data backup rules.
Click More > Trigger to manually trigger PostgreSQL data backup rules.
Click More > Delete to remove unused PostgreSQL data backup rules.
Configure backup in bucket configuration items
2. In the left navigation bar, select Bucket List, click the bucket for which you want to configure PostgreSQL data backup, and go to the bucket management page.
3. Click Function Compute on the left and locate the PostgreSQL Backup Function configuration item.
Note:
If you have not activated the SCF service, please go to the SCF Console to activate it, then complete the service authorization as prompted If you have not activated CLS, please go to the CLS Console to activate the service and complete the activation process by following the prompts 4. Click Add Function.
5. In the pop-up window, configure the following information:
Function Name: As the unique identifier of the function, it cannot be modified after creation. You can view this function on the SCF Console. Trigger Cycle: The PostgreSQL data backup function triggers the backup and archive operation via a timed trigger. The trigger cycle supports daily and custom intervals.
Cron Expression: When the trigger cycle is set to custom, you can specify the trigger cycle rule via Cron. Cron currently runs on UTC +8 China Standard Time (Beijing Time). For detailed configuration policies, see Cron-related Documentation. Database Instance: The list of PostgreSQL database instances in the region where the bucket is located.
Delivery Path: The prefix of the delivery path for backup files. If left blank, the files will be saved in the root path of the bucket by default.
SCF Authorization: PostgreSQL data backup requires authorizing SCF to read database instances and their backup files from your PostgreSQL backups, and archive the backup files to your specified bucket. Therefore, this authorization needs to be added.
6. After adding the configuration, click Confirm, and you will see that the function has been successfully added.
You can perform the following operations on the newly created function:
Click Log to view the historical operation status of PostgreSQL data backups. When backup errors occur, you can also click Log to quickly navigate to the SCF Console and examine detailed error logs.
Click Details to view detailed information about the function and trigger.
Click More > Edit to modify PostgreSQL data backup rules.
Click More > Trigger to manually trigger PostgreSQL data backup rules.
Click More > Delete to remove unused PostgreSQL data backup rules.