Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex Object Storage
    • All guides
      • Uploading an object
      • Multipart upload of an object
      • Get a list of bucket objects
      • Getting information about an object
      • Downloading an object
      • Restoring an object's version
      • Renaming and moving objects
      • Copying objects
      • Getting a pre-signed URL to download an object
      • Configuring an object lock
      • Deleting an object
      • Deleting all objects
      • Deleting a partially uploaded object
      • Editing an object's ACL
      • Managing object labels
      • Managing object custom metadata
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Bucket logs
  • Release notes
  • FAQ

In this article:

  • Renaming
  • Updating the prefix for an object group
  • Moving
  • Moving an object from one directory to another
  • Moving a directory with objects
  • Moving objects from one bucket to another
  1. Step-by-step guides
  2. Objects
  3. Renaming and moving objects

Renaming and moving objects

Written by
Yandex Cloud
Improved by
Tania L.
Updated at September 26, 2025
  • Renaming
    • Updating the prefix for an object group
  • Moving
    • Moving an object from one directory to another
    • Moving a directory with objects
    • Moving objects from one bucket to another

To work with objects in an encrypted bucket, a user or service account must have the following roles for the encryption key in addition to the storage.configurer role:

  • kms.keys.encrypter: To read the key, encrypt and upload objects.
  • kms.keys.decrypter: To read the key, decrypt and download objects.
  • kms.keys.encrypterDecrypter: This role includes the kms.keys.encrypter and kms.keys.decrypter permissions.

For more information, see Key Management Service service roles.

In addition to the Yandex Cloud CLI and AWS CLI, you can also use other supported tools, such as a file browser, to rename and move objects.

RenamingRenaming

Note

You can rename objects in the bucket. You cannot rename the bucket itself. However, you can create a new bucket and copy all objects from the source bucket into it.

Yandex Cloud CLI
AWS CLI

If you do not have the Yandex Cloud CLI installed yet, install and initialize it.

By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.

  1. See the description of the CLI command for renaming an object in a bucket:

    yc storage s3 mv --help
    
  2. Get a list of buckets in the default folder:

    yc storage bucket list
    

    Result:

    +------------------+----------------------+-------------+-----------------------+---------------------+
    |       NAME       |      FOLDER ID       |  MAX SIZE   | DEFAULT STORAGE CLASS |     CREATED AT      |
    +------------------+----------------------+-------------+-----------------------+---------------------+
    | first-bucket     | b1gmit33ngp6******** | 53687091200 | STANDARD              | 2022-12-16 13:58:18 |
    +------------------+----------------------+-------------+-----------------------+---------------------+
    
  3. Run this command:

    yc storage s3 mv \
      s3://<bucket_name>/<object_key> \
      s3://<bucket_name>/<new_object_key>
    

    Result:

    move: s3://my-bucket/object.txt to s3://my-bucket/renamed-object.txt
    

For more information about the yc storage s3 mv command, see the documentation.

  1. If you do not have the AWS CLI yet, install and configure it.

  2. To rename an object, run this command:

    aws --endpoint-url=https://storage.yandexcloud.net/ \
      s3 mv s3://<bucket_name>/<object_key> s3://<bucket_name>/<new_object_key>
    

    Where:

    • --endpoint-url: Object Storage endpoint.
    • s3 mv: Command to rename or move an object. To rename an object, in the first part of the command, provide the bucket name and the current key of the object you want to rename, and in the second part, the bucket name and the new object key.

    Result:

    move: s3://<bucket_name>/<object_key> to s3://<bucket_name>/<new_object_key>
    

For more information about the aws s3 mv command, see this article in the AWS CLI command reference.

Updating the prefix for an object groupUpdating the prefix for an object group

Yandex Cloud CLI
AWS CLI

If you do not have the Yandex Cloud CLI installed yet, install and initialize it.

By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.

To update the prefix for an object group, run this command:

yc storage s3 mv --recursive \
  s3://<bucket_name>/<prefix>/ \
  s3://<bucket_name>/<new_prefix>/

Result:

move: s3://my-bucket/my-prefix/ to s3://my-bucket/renamed-prefix/

For more information about the yc storage s3 mv command, see the documentation.

  1. If you do not have the AWS CLI yet, install and configure it.

  2. Run this command:

    aws --endpoint-url=https://storage.yandexcloud.net/ \
      s3 mv --recursive s3://<bucket_name>/<prefix>/ s3://<bucket_name>/<new_prefix>/
    

    Where:

    • --endpoint-url: Object Storage endpoint.
    • s3 mv: Command to rename or move an object. To rename an object, in the first part of the command, provide the bucket name and the current prefix of the object group you want to rename, and in the second part, the bucket name and the new prefix for the object group.
    • --recursive: Parameter for updating the prefix for an object group.

    Result:

    move: s3://<bucket_name>/<prefix>/ to s3://<bucket_name>/<new_prefix>/
    

For more information about the aws s3 mv command, see this article in the AWS CLI command reference.

MovingMoving

Yandex Cloud CLI
AWS CLI

If you do not have the Yandex Cloud CLI installed yet, install and initialize it.

By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.

  1. Read the description of the CLI command for moving an object:

    yc storage s3 mv --help
    
  2. Get a list of buckets in the default folder:

    yc storage bucket list
    

    Result:

    +------------------+----------------------+-------------+-----------------------+---------------------+
    |       NAME       |      FOLDER ID       |  MAX SIZE   | DEFAULT STORAGE CLASS |     CREATED AT      |
    +------------------+----------------------+-------------+-----------------------+---------------------+
    | first-bucket     | b1gmit33ngp6******** | 53687091200 | STANDARD              | 2022-12-16 13:58:18 |
    +------------------+----------------------+-------------+-----------------------+---------------------+
    
  3. Run this command:

    yc storage s3 mv \
      s3://<source_bucket_name>/<object_key> \
      s3://<target_bucket_name>/<object_key>
    

    Result:

    move: s3://my-bucket/object.txt to s3://new-bucket/object.txt
    
  1. If you do not have the AWS CLI yet, install and configure it.

  2. To move an object, e.g., from one bucket to another, run this command:

    aws --endpoint-url=https://storage.yandexcloud.net/ \
      s3 mv s3://<source_bucket_name>/<object_key> s3://<target_bucket_name>/<object_key>
    

    Where:

    • --endpoint-url: Object Storage endpoint.
    • s3 mv: Command to rename or move an object. To move an object, in the first part of the command, provide the source bucket name and the key of the object you want to move, and in the second part, the target bucket name and the object key.

    Result:

    move: s3://<source_bucket_name>/<object_key> to s3://<target_bucket_name>/<object_key>
    

For more information about the aws s3 mv command, see this article in the AWS CLI command reference.

Moving an object from one directory to anotherMoving an object from one directory to another

In Object Storage, directories are simulated using key prefixes. To move an object from one directory to another, rename its key prefix, e.g.:

Yandex Cloud CLI
AWS CLI
yc storage s3 mv \
  s3://<bucket_name>/<prefix>/<object_name> \
  s3://<bucket_name>/<new_prefix>/<object_name>

Result:

move: s3://my-bucket/my-prefix/object.txt to s3://my-bucket/renamed-prefix/object.txt
aws --endpoint-url=https://storage.yandexcloud.net/ \
  s3 mv s3://<bucket_name>/<prefix>/<object_name> s3://<bucket_name>/<new_prefix>/<object_name>

Result:

move: s3://my-bucket/my-prefix/object.txt to s3://my-bucket/renamed-prefix/object.txt

Moving a directory with objectsMoving a directory with objects

In Object Storage, directories are simulated using key prefixes. To move a directory with objects, update the prefix for an object group.

Moving objects from one bucket to anotherMoving objects from one bucket to another

Yandex Cloud CLI
AWS CLI

If you do not have the Yandex Cloud CLI installed yet, install and initialize it.

By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.

Run this command:

yc storage s3 mv --recursive \
  s3://<source_bucket_name>/ \
  s3://<target_bucket_name>/

Result:

move: s3://my-bucket/object1.txt to s3://new-bucket/object1.txt
move: s3://my-bucket/object2.txt to s3://new-bucket/object2.txt
  1. If you do not have the AWS CLI yet, install and configure it.

  2. Run this command:

    aws --endpoint-url=https://storage.yandexcloud.net/ \
      s3 mv --recursive s3://<source_bucket_name> s3://<target_bucket_name>
    

    Where:

    • --endpoint-url: Object Storage endpoint.
    • s3 mv: Command to rename or move an object. To move all objects, in the first part of the command, provide the source bucket name, and in the second part, the target bucket name.
    • --recursive: Parameter for moving all objects from one bucket to another.

    Result:

    move: s3://<source_bucket_name>/<object_1_key> to s3://<target_bucket_name>/<object_1_key>
    move: s3://<source_bucket_name>/<object_2_key> to s3://<target_bucket_name>/<object_2_key>
    

For more information about the aws s3 mv command, see this article in the AWS CLI command reference.

Was the article helpful?

Previous
Restoring an object's version
Next
Copying objects
© 2025 Direct Cursus Technology L.L.C.