Skip to main content

Renaming Objects

Tigris allows you to rename objects without rewriting the data so renames are fast and cost-effective. Because Tigris utilizes an object metadata service, renaming an object updates its metadata in place. You can rename objects in the Tigris Dashboard and via passing an additional header on the CopyObject command using your existing S3 tools.

Renaming Objects using the Dashboard

To rename files or objects using the Tigris console, follow these steps.

Here is a step-by-step visual guide:

  1. Open the Tigris Console: Go to Tigris Console and log in.
  2. Go to the Buckets Section: In the side navigation, click on "Buckets". Select the desired bucket and locate the file you want to rename. Click the "Rename" option from the action menu next to the file.

Tigris File Browser

  1. Enter the New Name: Type the new name in the provided input field. Tigris Rename Object Popup

  2. Confirm the Rename: Click "Save" to apply the new name.

  3. Verify the Change: Check the list to ensure the object/file has been updated.

Tigris Rename Object Success modal

Renaming Objects using AWS SDKs

To rename an object using AWS SDK, attach the X-Tigris-Rename: true header to a CopyObject request.

X-Tigris-Rename: true

This is not supported in every AWS SDK. For the languages that are not listed below, you must use the console to rename objects.

func WithRename() func(*s3.Options) {
return func(options *s3.Options) {
options.APIOptions = append(options.APIOptions, http.AddHeaderValue("X-Tigris-Rename", "true"))
}
}

// rename the object in the bucket
_, err = client.CopyObject(ctx, &s3.CopyObjectInput{
Bucket: aws.String(bucketName),
CopySource: aws.String(bucketName + "/" + keyName),
Key: aws.String(targetName),
}, WithRename())
if err != nil {
log.Fatalf("Unable to rename object. Here's why: %v", err)
}