How to Rename or Move Files in S3 Object Storage

Files are stored as objects in S3-compatible object storage with object keys. Objects with key prefixes usually result in a folder-like structure.

Usually you want to move or rename an object . You copy it to a new key , then delete the original object . The exact process will vary depending on the features of your storage panel or application.

How to Rename a File

To change the name of a file in a Space:

  1. Click to open your S3 Object Storage dashboard.

  2. Choose the Space in which the file is located.

  3. Locate the file you want to rename.

  4. Verify that there is a Rename option for the pane.

  5. If rename is not supported copy file to the same location with new name.

  6. Verify that the new file exists and opens properly.

  7. Delete the original file only after the copy was successful.

Example:

The original key was

documents/report.pdf

New object key:

documents/annual-report.pdf

The file content remains the same; only the object key changes.

How to Move a File to Another Folder-Like Location

To move a file to another folderish place:

  1. Open the Space that the file is stored in.

  2. Find the object you want to move.

  3. Locate the destination prefix.

  4. Copies the object to the destination, using the new object key.

  5. Make sure the copied file is available.

  6. Delete the original object after confirming the copy is complete.

Example:

Original object key:

images/photo.jpg

Destination object key:

archive/images/photo.jpg

The archive/images/ prefix is now used to store it. Depending on the panel, you may have to create the destination prefix or type in the full destination key by hand.

Why Renaming and Moving May Work Differently

In S3 compatible object storage folders are not handled like they are in a file system of a computer. Object keys often have prefixes that are folder-like locations.

For example:

If I move reports/january.pdf to archive/reports/january.pdf, the object's key would change. It doesn’t necessarily transfer a file from one physical folder to another.

Since an object key points to an object, the usual way to rename or move an object is to copy the object and then delete the original.

Important Limitations

What to Do If You Cannot Rename or Move a File

If your storage panel does not offer a rename or move option:

  1. Check whether it provides a copy or duplicate option.

  2. If available, copy the object to the required destination and use the desired name.

  3. Verify the copied object before deleting the original.

  4. If the panel does not support copying, use an S3-compatible client or application that supports copying objects.

  5. Confirm that your credentials have permission to read the source object, write to the destination, and delete the original if deletion is required.

Do not delete the original file until you have confirmed that the new object exists and works as expected.

Security tip: Never share secret access keys or passwords when troubleshooting object-copy or rename issues.