Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Versioning

Updated on 2024-10-24 GMT+08:00

Scenarios

OBS can store multiple versions of an object. You can quickly search for and restore different versions or restore data in the event of accidental deletions or application faults.

By default, versioning is disabled for a new OBS bucket. New objects will overwrite existing objects in the bucket in case they have the same names.

Constraints

When you enable WORM for a bucket, OBS automatically enables versioning and versioning cannot be suspended later for that bucket.

Enabling Versioning

  • Enabling versioning does not change the version ID (null) and content of any existing object in a bucket. After versioning is enabled for a bucket, if you upload a new object with the same name as an existing object, a version ID will be assigned to this new object, as shown in Figure 1.
    Figure 1 Versioning (with existing objects)
  • In a versioning-enabled bucket, OBS automatically assigns a unique version ID to each newly uploaded object. Objects with the same name are stored in OBS with different version IDs, as shown in Figure 2.
    Figure 2 Versioning (for new objects)
    Table 1 Version description

    Version

    Description

    Latest version

    After versioning is enabled, each operation on an object will result in saving of the object with a new version ID. The version ID generated upon the latest operation is called the latest version.

    Historical version

    After versioning is enabled, each operation on an object will result in saving of the object with a new version ID. Version IDs generated upon operations other than the latest operation are called historical versions.

  • The latest objects in a bucket are returned by default after a GET Object request.
  • Objects can be downloaded by version IDs. By default, the latest object is downloaded if the version ID is not specified. For details, see Related Operations in Versioning.
  • You can select an object and click Delete on the right to delete the object. After the object is deleted, OBS inserts a delete marker with a unique version ID for that object, and the deleted object is displayed in the Deleted Objects list. For details, see Deleting an Object. If attempts are then made to access this deleted object, error 404 will be returned.
    Figure 3 Object with a delete marker
  • You can recover a deleted object by deleting the delete marker. For details, see Related Operations.
  • After an object is deleted, you can specify the version number in Deleted Objects to permanently delete the object of the specified version. For details, see Deleting Objects from a Bucket with Versioning Disabled, Suspended, or Enabled.
  • An object appears in either the object list or the list of deleted objects. It will never appear in both lists at the same time.

    For example, after object A is deleted, it will appear in the Deleted Objects list. If you later upload another object with the same name A, the new object A will appear in the Objects list, but the previously deleted object A will disappear from the Deleted Objects list. For details, see Figure 4.

    Figure 4 Uploading a namesake object after the original one is deleted
  • All object versions except those with Delete Marker stored in OBS are charged.

Suspending Versioning

Once versioning is enabled for a bucket, it cannot be disabled, but it can be suspended. When versioning is suspended, a null, not a specific version ID, will be allocated to a newly uploaded object. If the newly uploaded object has the same name as an existing object with a null version ID, the new object will overwrite the existing object.

Figure 5 Object versions in the scenario when versioning is suspended

If versioning is no longer needed, you can suspend it. After versioning is suspended:

  • Existing object versions are still retained in OBS. If you no longer desire these versions, manually delete them.
  • Objects can be downloaded by version IDs. By default, the latest object is downloaded if the version ID is not specified.
  • All historical object versions except those with Delete Marker stored in OBS are charged.

Differences Between Scenarios When Versioning Is Suspended and Disabled

If you delete an object from a versioning-suspended bucket, a delete marker with a null version ID will be generated, no matter whether the object has historical versions. But, if versioning is disabled, the same operation will not generate a delete marker.

NOTE:

In a versioning-enabled bucket, each historical version of an object is stored and you will be billed for the storage of all object versions. Therefore, enable versioning when necessary.

Ways to Configure Versioning

You can use OBS Console, APIs, or SDKs to configure versioning.

Related Operations

After versioning is configured for a bucket, you can go to the object details page, click the Versions tab, and then delete, share, and download object versions, and extend the retention period of an object version.

  1. In the navigation pane of OBS Console, choose Object Storage.
  2. In the bucket list, click the bucket you want to operate. The Objects page is displayed.
  3. In the object list, click the object you want to go to the object details page.
  4. On the Versions tab page, view all versions of the object.
  5. Perform the following operations on object versions:

    1. Download a desired version of the object by clicking Download in the Operation column.
      NOTE:

      If the version you want to download is in the Archive or Deep Archive storage class, restore it first.

    2. Share a version of the object by clicking Share in the Operation column.
    3. Delete a version of the object by choosing More > Delete in the Operation column. If you delete the latest version, the most recent version will become the latest version.
      NOTE:

      In a WORM-enabled bucket, if an object has no retention policy configured or its retention policy has expired, you can delete a desired object version on the object's Versions tab page. If an object version is within the retention period, it cannot be deleted.

    4. Locate the object version for which you want to extend the retention period, choose More > Extend Retention Period, and select a date. A retention period can only be extended, but not shortened.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback