tencent cloud

Configuration
Last updated: 2025-10-15 17:15:03
Configuration
Last updated: 2025-10-15 17:15:03

Scenarios

Cross-bucket replication enables you to replicate objects from a source bucket to a destination bucket. This feature is well suited for use cases such as remote disaster recovery, industry compliance, data migration and backup, access latency reduction, and access to the data located in different regions.
Special use cases:
Multi-region backup: You can configure multiple replication rules for the source bucket to replicate objects to buckets in different regions for multi-region backup and disaster recovery.
Two-way replication: You can create replication rules in the source and destination buckets respectively to implement two-way data replication.
Note:
When versioning is enabled, newly uploaded objects with the same name will generate historical versions and occupy storage space. Therefore, storage fees will be charged for these versioned objects as well.

How to Use

Using COS console

Enabling Bucket Replication

1. Log in to the COS Console.
2. In the left sidebar, click bucket list.
3. Click the source bucket that needs to configure bucket replication to enter the bucket details page.
4. Select Fault Tolerance and Disaster Recovery Management > Bucket Replication on the left side to enter the current page.
5. In the Bucket Replication section, click Add Rule. The configuration items are described as follows:
Basic information

Status: The current status of the rule.
Source Region: The region to which your source bucket belongs.
Application scope: Refers to objects in the source bucket that need to be copied, supporting selection of the entire bucket or a specified range.
Entire bucket: Refers to copying all incremental objects from the source bucket to the destination bucket.
Specified range: Refers to filtering incremental objects pending copy by object prefix or object tag. When you choose specified range, configure at least one of the following:
Object prefix: You can specify objects with the same object key prefix to execute the bucket replication rule, such as prefix/. Regular expressions are not supported.
Object tag: You can specify objects with the same tag to execute the bucket replication rule. Support up to 10 tags. Case-sensitive.
Note:
You can specify both object prefix and object tags. The relationship between object prefix and object tags, or between object tags is "AND" (all conditions must be satisfied simultaneously). For example, if you specify the object prefix as "doc" and the tag key-value pair as group = IT in the bucket replication rule, the specified object range includes all incremental objects in the current bucket with the object key prefix "doc" and the tag "group = IT".
Rule configuration

Target bucket: The bucket where the copied object is stored. You can select a bucket in the same region as or different regions from the source bucket. Buckets not in the current account cannot be selected. Once set, when adding multiple bucket replication rules later, only previously designated target buckets in the same region are allowed.
Note:
If versioning is not enabled for both the source bucket and target bucket, please first enable versioning feature before reconfiguring the bucket replication rule.
Assuming rule 1 specifies bucket A in Nanjing as the target bucket. If you add rule 2 and specify Nanjing as the target bucket, you can only select bucket A, otherwise an error will occur.
Target storage type: The storage type of objects after they are replicated to the destination bucket. You can select different storage types to change the type of copied objects in the target bucket. Some storage types are applicable only to partial regions. For the introduction and region description of storage types, please see Storage Class Overview.
Sync deletion marker: Supports selecting sync or out of sync. Default is out of sync.
Sync: If you select to sync the deletion marker, bucket replication will copy the marker to the target bucket. Choose carefully. When a source bucket file is deleted, the bucket replication behavior is as follows:
When deleting a file without specifying a Version ID, COS will add a deletion marker in the source bucket. Bucket replication will copy this marker to the destination bucket, and the target bucket file will also be deleted.
When deleting a file with a specified Version ID, COS will delete the specified object version in the source bucket, but will not replicate this delete operation to the destination bucket. That is, COS will not delete this specified object version in the destination bucket. This action prevents malicious data deletion.
Asynchronous: If you choose not to sync the deletion marker, the target bucket will not add a new deletion marker. When a source bucket file is deleted, bucket replication will not copy the deletion marker to the target bucket, and the target bucket file remains unaffected.
In two cases, the target bucket will not actually delete the corresponding file. Users can still access the noncurrent version of the object by specifying the Version ID. For more details about version control and deletion markers, see the Versioning Overview document.
Note:
Deletion markers generated by lifecycle rules and settlement operations will not be synchronized to the destination bucket. If you wish the destination bucket to delete expired objects, you must configure the same lifecycle rule for the destination bucket as the source bucket. For details, see Bucket Replication Overview and Replication Behavior Description.
When application scope is set to a specified range and the selection range is an object tag, you are unable to select the sync deletion marker on the rule configuration page.
Rule priority: The priority of the current bucket replication rule. The system will allocate priority to each rule by default logic. If modification is needed, click Adjust Priority on the rule list page. For details, see Adjust Rule Priority.
6. After confirming the information is correct and checking the authorization box, click Confirm, and you will see the bucket replication rule.

Note:
After completing rule configuration, you can perform management operations. Click the Edit button to modify the current rule and status, or click Delete to remove the current rule.

Adjusting Bucket Replication Rule Priority

Note:
Priority supports 1-1000. The smaller the number, the higher the priority.
The priority of different rules must be unique.
If you have configured bucket replication rules before upgrading the feature, these rules have no priority and show as "-". Details as follows:
If you add or edit rules subsequently, the default logic will assign priority to your previously configured rules, converting old rules to new ones with a priority field. You can adjust the priority based on your business needs.
If you do not add or edit rules subsequently, bucket replication will still be performed according to your previous rules.
You can adjust the priority of bucket replication rules in the following ways. Directions:

1. On the bucket replication rule list page, click adjust priority.
2. Adjust the priority using the plus/minus buttons or enter the expected priority.
3. Click Confirm to complete the priority adjustment of the bucket replication rule.

Disabling Bucket Replication

Note:
Ongoing cross-region replication operations are aborted when cross-region replication is disabled and cannot be resumed.
Cross-region replication is performed only on new objects after it is enabled again for buckets.
You can disable the bucket replication feature in two ways: by editing the rule or by deleting the rule.

Edit Rule: In the Bucket Replication management item, edit the added rules and temporarily disable the current rule using the status button within the rules. This will suspend the bucket replication feature. The replicated data will remain in the destination bucket, and incremental data in the source bucket will no longer be copied to the target bucket. If you want to use it again, just click the Enable button.
Delete Rule: Delete the added rules under the Bucket Replication management item. After a rule is deleted, the configured bucket replication rule will become invalid. The replicated data will remain in the target bucket, and incremental data in the source bucket will no longer perform bucket replication. If you want to use it again, you need to add rules again.

Using the REST API

You can configure and manage cross-bucket replication rules through RESTful APIs as described in the following API documents:

Using SDKs

You can directly call the cross-bucket replication method in SDKs. For more information, see the SDK documentation for the corresponding programming language below:
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback