Move data between buckets Stay organized with collections Save and categorize content based on your preferences.
This page describes how to move the contents of a bucket by copying objects froma source bucket to a destination bucket.
Overview
When you create a bucket, some of the properties you set are permanent andcannot be changed, including the bucket's name and its parent project.
If you want to use a new name for your bucket, you caneffectively do so bycreating a new bucket with the name you want to use, and then copying yourobjects from the old bucket to the new bucket. You can thendelete theold bucket. Note the following:
When you delete a bucket, thebucket's name can be reused.
Important: If you create a new bucket with the same name as the originalbucket but in a different location, requests made to the new bucket might failwith a404-Bucket Not Founderror for up to 10 minutes after the deletion ofthe original bucket. For theXML API, this behavior includes attempts tocreate the new bucket.If your primary goal of moving objects from one bucket to another is tostore your data in a differentbucket location, we recommenddirectly relocating your bucket.
Moving data between locations incursnetwork usage costs. Inaddition, moving data might incur additional charges, depending on thestorage classes of the source data and on the location of the destinationbucket. For more information, seeCloud Storage pricing.
Required permissions
Console
In order to complete this guide using theGoogle Cloud console, you musthave the proper IAM permissions. If the buckets you want toaccess exist in a project that you did not create, you might need theproject owner to give you a role that contains the necessary permissions.
For a list of permissions required for specific actions, seeIAMpermissions for the Google Cloud console.
For a list of relevant roles, seeCloud Storage roles.Alternatively, you cancreate a custom role that hasspecific, limited permissions.
Command line
In order to complete this guide using a command-line utility, you musthave the proper IAM permissions. If the buckets you want toaccess exist in a project that you did not create, you might need theproject owner to give you a role that contains the necessary permissions.
For a list of permissions required for specific actions, seeIAMpermissions forgcloud storage commands.
For a list of relevant roles, seeCloud Storage roles.Alternatively, you cancreate a custom role that hasspecific, limited permissions.
REST APIs
JSON API
In order to complete this guide using theJSON API, you must havethe proper IAM permissions. If the buckets you want toaccess exist in a project that you did not create, you might needthe project owner to give you a role that contains the necessarypermissions.
For a list of permissions required for specific actions, seeIAMpermissions for JSON methods.
For a list of relevant roles, seeCloud Storage roles.Alternatively, you cancreate a custom role that hasspecific, limited permissions.
Move data from one bucket to another
Console
Use theStorage Transfer Service from within Google Cloud console:
- If you don't have a destination bucket yet,create the bucket.
Open the Transfer page in the Google Cloud console.
- ClickCreate transfer job.
Follow the step-by-step walkthrough, clickingNext step as youcomplete each step:
Choose a source: UseGoogle Cloud Storage bucket as your sourcetype, and either enter the name of the wanted bucket directly, orclickBrowse to find and select the bucket you want.
Choose a destination: Either enter the name of the wanted bucketdirectly, or clickBrowse to find and select the bucket you want.
Choose settings: Select the optionDelete files from source afterthey're transferred.
Scheduling options: You can ignore this section.
After you complete the step-by-step walkthrough, clickCreate.
This begins the process of copying objects from your old bucket intoyour new one. This process may take some time; however, after you clickCreate, you can navigate away from the Google Cloud console.
To view the transfer's progress:
Open the Transfer page in the Google Cloud console.
To learn how to get detailed error information about failed Cloud Storage operations in the Google Cloud console, seeTroubleshooting.
Once the transfer completes, you don't need to do anything to delete theobjects from your old bucket if you selected theDelete source objectsafter the transfer completes checkbox during setup. You may, however,want to alsodelete your old bucket, which you must do separately.
Command line
If you don't have one yet,create a destination bucket.
To recursively copy the contents of your source bucket to yourdestination bucket, use the
gcloud storage cpcommand withthe--recursiveoption:gcloud storage cp --recursive gs://SOURCE_BUCKET/* gs://DESTINATION_BUCKET
Where:
SOURCE_BUCKETis the name of your originalbucket. For example,old-bucket.DESTINATION_BUCKETis the name of thebucket you are moving your data to. For example,my-bucket.
If your bucket usesmanaged folders and aflat namespace,you must include the flag
--include-managed-foldersin the commandfor the managed folders to be copied.To recursively delete the contents from the source bucket, along withthe source bucket itself, use the
gcloud storage rmcommandwith the--recursiveoption:gcloud storage rm --recursive gs://SOURCE_BUCKET
Where
SOURCE_BUCKETis the name of youroriginal bucket. For example,old-bucket.Alternatively, to delete the contents from the source bucket withoutdeleting the source bucket itself, use the
gcloud storage rmcommandwith the--all-versionsflag and**wildcard:gcloud storage rm --all-versions gs://SOURCE_BUCKET/**
Where
SOURCE_BUCKETis the name of youroriginal bucket. For example,old-bucket.
REST APIs
JSON API
If you don't have a destination bucket yet,create the bucket.
Copy each object from your source bucket to the destinationbucket.
Delete each object in your source bucket.
XML API
If you don't have a destination bucket yet,create the bucket.
Copy each object from your source bucket to the destinationbucket.
Delete each object in your source bucket.
What's next
Learn aboutavailable bucket locations andbucket naming guidelines.
Learn more aboutcreating and managing data transfers with the Google Cloud console.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-19 UTC.