Docs · Object storage

Versioning: get back what was overwritten.

One wrong upload or delete can replace the only copy of a file. With versioning on, the bucket keeps the older versions until you delete them.

Without versioning, an upload to an existing name replaces the file, and a delete removes it. With versioning on, every upload adds a new version and keeps the previous one. A delete only hides the file behind a delete marker, and you can undo it.

The examples use the AWS CLI profile the panel gives you when you create an access key (Object storage → Access keys → New key), so every command carries --profile computeforge --endpoint-url https://s3.computeforge.com. Any S3 client works the same way.

Turn it on

aws s3api put-bucket-versioning --bucket my-bucket \
  --versioning-configuration Status=Enabled \
  --profile computeforge --endpoint-url https://s3.computeforge.com

As in S3, a bucket that has had versioning on can be suspended (Status=Suspended) but never turned back off. While suspended, new uploads replace the file's version without an id (the null version), and the versions already kept stay until you delete them.

See and restore older versions

# every version and delete marker under a prefix
aws s3api list-object-versions --bucket my-bucket --prefix reports/ \
  --profile computeforge --endpoint-url https://s3.computeforge.com

# download one version
aws s3api get-object --bucket my-bucket --key reports/q3.pdf \
  --version-id <VersionId> q3-old.pdf \
  --profile computeforge --endpoint-url https://s3.computeforge.com

# make an older version current again (copied as the newest version)
aws s3api copy-object --bucket my-bucket --key reports/q3.pdf \
  --copy-source "my-bucket/reports/q3.pdf?versionId=<VersionId>" \
  --profile computeforge --endpoint-url https://s3.computeforge.com

# undo a delete: remove the delete marker
aws s3api delete-object --bucket my-bucket --key reports/q3.pdf \
  --version-id <DeleteMarker VersionId> \
  --profile computeforge --endpoint-url https://s3.computeforge.com

delete-object with --version-id deletes that version for good. Without it, it only adds a delete marker. rclone shows older versions with --s3-versions. Files in a public bucket are served to anyone at their current version only; older versions always need a key.

How older versions are billed

  • Every version is stored data. Older (noncurrent) versions are billed the same way as current files: per GB-month of storage, at the object storage price shown on the Object storage page in the panel. A file uploaded ten times and kept in all ten versions is billed as ten copies.
  • They count against the workspace's storage quota, and they are included in the bucket's size in the panel.
  • Delete markers hold no data, so they add nothing to the stored size.
  • Parts of multipart uploads that were never finished are stored data too, until the upload is completed or aborted.
  • Storage is measured every 15 minutes, and a GB is 109 bytes. A version stops costing anything once it is deleted.

To keep this in check, let a lifecycle rule delete older versions after some days, or keep only the newest few.

Deleting a versioned bucket

A bucket can only be deleted when it holds nothing: no files, no older versions and no delete markers. If the panel says the bucket is not empty but its file list looks empty, older versions or delete markers are left. Use Empty bucket (all versions) on the bucket in the panel. It deletes every version and delete marker for good, after you type the bucket's name. Then delete the bucket. With rclone, rclone backend cleanup-hidden removes the older versions of a bucket.

Deleted archives and backups

Archives (your cf-archive- bucket) are kept for 30 days after they are deleted, and backups in a cf-backup- bucket for 30 days after they pass their retention, then erased for good. A deleted one disappears from the bucket at once and stops counting toward your storage and your bill. If you delete an archive by mistake, or need an expired backup back, contact support within those 30 days and we can bring it back.

More on object storage