All Products
Search
Document Center

Object Storage Service:Convert appendable objects to the Cold Archive storage class

Last Updated:Mar 20, 2026

OSS lifecycle rules cannot directly transition appendable objects to the Cold Archive or Deep Cold Archive storage class — appendable objects remain in a writable state, which blocks lifecycle transitions. To work around this, use the SealAppendObject operation to convert appendable objects to normal objects first, then configure a lifecycle rule to handle the transition automatically.

The examples in this topic use appendable objects in the examplebucket bucket with the prefix appendobjects/ that were last modified more than 30 days ago.

Prerequisites

Before you begin, ensure that you have:

  • Submitted a ticket at the Alibaba Cloud service center to get approval for the SealAppendObject operation

  • A prefix that is specific enough to avoid accidentally transitioning other objects (for example, appendobjects/)

How it works

  1. List all appendable objects that match your target criteria.

  2. Run SealAppendObject on each object to convert it to a normal object.

  3. Configure a lifecycle rule to transition the converted objects to Cold Archive.

After you configure the lifecycle rule, it takes effect and runs for the first time early on the following day.

Lifecycle rules apply to normal objects — objects uploaded with PutObject, multipart upload, or appendable objects converted with SealAppendObject.

Step 1: List the appendable objects to process

Filter your bucket to find all appendable objects eligible for conversion. The target objects must meet all four conditions:

  • Object type is Appendable

  • Storage class is not ColdArchive or DeepColdArchive

  • Last-Modified is more than 30 days ago

  • The SealedTime field is absent (object has not been sealed)

Important

The Last-Modified behavior depends on whether versioning is enabled on the bucket:

  • Versioning disabled: Last-Modified updates each time you append data to the object.

  • Versioning enabled or suspended: Last-Modified is set at initial upload and does not update on subsequent appends. As a result, this filter returns all appendable objects initially uploaded more than 30 days ago, regardless of when data was last appended.

ossutil

ossutil ls oss://examplebucket/appendobjects/ -r -q --short-format \
  --min-age=30d \
  --metadata-exclude="x-oss-storage-class=*ColdArchive" \
  --metadata-exclude="x-oss-sealed-time=*" \
  --metadata-include="x-oss-object-type=Appendable"

Sample output:

oss://examplebucket/appendobjects/unsealed_object1.txt
oss://examplebucket/appendobjects/unsealed_object2.txt
oss://examplebucket/appendobjects/unsealed_object3.txt

API

Call GetBucket (ListObjects) or ListObjectsV2 (GetBucketV2) to list objects under the prefix, then filter the results using the four conditions above.

Step 2: Seal the appendable objects

Run SealAppendObject on each object from Step 1. SealAppendObject requires the current object size as the position parameter, so retrieve the size first.

ossutil

Repeat the following two commands for each object:

  1. Get the object size (Content-Length):

       ossutil stat oss://examplebucket/appendobjects/unsealed_object1.txt
  2. Seal the object, passing the Content-Length value as position:

       ossutil api invoke-operation \
         --op-name seal \
         --method POST \
         --bucket examplebucket \
         --key appendobjects/unsealed_object1.txt \
         --parameters seal \
         --parameters position=65536

API

For each object:

  1. Get the object size: retrieve the <Size> value from the GetBucket (ListObjects) or ListObjectsV2 (GetBucketV2) response.

  2. Call SealAppendObject with the <Size> value as the position parameter. The object is converted to a non-appendable state.

Step 3: Create a lifecycle rule

Configure a lifecycle rule to automatically transition the sealed objects to Cold Archive storage.

Console

  1. Log on to the OSS console.

  2. Click Buckets, then click examplebucket.

  3. Choose Data Management > Lifecycle.

  4. Click Create Rule and configure the settings as shown below. Keep the defaults for all other parameters.

    AreaConfiguration itemValue
    Basic settingsStatusStart
    Applied toObject Prefix
    Prefixappendobjects/
    Policy for current versionsObject lifecycleSpecify Days
    Lifecycle-based rulesTransition to Cold Archive 30 days after last Modified Time
  5. Click OK.

ossutil

  1. Create a file named lifecycle.xml with the following content:

       <LifecycleConfiguration>
         <Rule>
           <ID>rule1</ID>
           <Prefix>appendobjects/</Prefix>
           <Status>Enabled</Status>
           <Transition>
             <Days>30</Days>
             <StorageClass>ColdArchive</StorageClass>
           </Transition>
         </Rule>
       </LifecycleConfiguration>
  2. Apply the rule to the bucket:

       ossutil api put-bucket-lifecycle --bucket examplebucket --lifecycle-configuration file://lifecycle.xml

API

Call PutBucketLifecycle with the XML content in the request body:

PUT /?lifecycle HTTP/1.1
Host: oss-examplebucket.oss.aliyuncs.com
Content-Length: 336
Date: Mon, 6 May 2025 15:23:20 GMT
Authorization: OSS4-HMAC-SHA256 Credential=LTAI********************/20250506/cn-hangzhou/oss/aliyun_v4_request,AdditionalHeaders=content-length,Signature=a7c3554c729d71929e0b84489addee6b2e8d5cb48595adfc51868c299c0c218e

<?xml version="1.0" encoding="UTF-8"?>
<LifecycleConfiguration>
  <Rule>
    <ID>rule1</ID>
    <Prefix>appendobjects/</Prefix>
    <Status>Enabled</Status>
    <Transition>
      <Days>30</Days>
      <StorageClass>ColdArchive</StorageClass>
    </Transition>
  </Rule>
</LifecycleConfiguration>

Verify the results

The lifecycle rule takes effect and runs for the first time early the following day. To confirm the transition was successful, check the storage class of the target objects:

  • OSS console: Navigate to the bucket and inspect the object details.

  • ossutil: Run ossutil stat oss://examplebucket/appendobjects/<object-name> and check the StorageClass field.