# How to Migrate an S3 Bucket to Another AWS Account💡

Need to move an S3 bucket to another AWS account? Whether you’re handing over data to a client, reorganizing resources, or consolidating accounts, this guide breaks it down into easy, actionable steps. No fluff, no jargon just a clear roadmap to get your S3 bucket migrated quickly and efficiently. Let’s dive in!

---

# **Step 1: Share the S3 Bucket with the Destination Account ⚙️**

> 📌 AWS doesn’t let you “move” a bucket directly, but you can **share it** and copy its contents.  
> Here’s how:

1. Go to the **S3 Console** in the **source account**.
    
2. Select the bucket you want to migrate.
    
3. Click the **Permissions tab**
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1738409178906/25c3cf1c-61f5-4b62-867b-15fd51d6e0e7.png align="left")
    
4. Add a bucket policy to grant access to the destination account by adding the below policy.
    
    ```json
    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Effect": "Allow",
          "Principal": {
            "AWS": "arn:aws:iam::DESTINATION_ACCOUNT_ID:root"
          },
          "Action": [
            "s3:ListBucket",
            "s3:GetObject"
          ],
          "Resource": [
            "arn:aws:s3:::SOURCE_BUCKET_NAME",
            "arn:aws:s3:::SOURCE_BUCKET_NAME/*"
          ]
        }
      ]
    }
    ```
    
    Replace `DESTINATION_ACCOUNT_ID` and `SOURCE_BUCKET_NAME` with your details.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1738409298993/85816176-12f2-4071-9ef2-db44718f64b1.png align="left")
    
5. Save the policy. Now, the destination account can access the bucket.
    

---

# **Step 2: Copy the Bucket Contents to the Destination Account ☕🗺️**

Once shared, **copy the data** to a new bucket in the destination account.

1. Log in to the **destination account** and create a **new bucket**.
    
2. Use the **AWS CLI** to copy the files: (**Use destination account credentials)**
    
    ```bash
    aws s3 sync s3://SOURCE_BUCKET_NAME s3://DESTINATION_BUCKET_NAME
    ```
    
    **Expected Output:**
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1738409404167/472fd46c-2e66-406a-91cb-1a76fc2709b3.png align="left")
    

---

# **Step 3: Verify the Data ✅**

After copying, **check the data** in the destination bucket:

* Confirm the **file count** and **size** match the source.
    
* Open a few files to ensure they’re intact.
    
* If the bucket has versioning, verify all versions were copied.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1738409429507/16a6a372-7ee4-4ca3-8c76-a2cad698ac18.png align="left")
    

---

# **Pro Tips: 🚀**

* **Use AWS Datasync** for large buckets to speed up transfers.
    
* **Enable versioning** in the destination bucket if the source has it.
    
* **Test the process** with a small bucket before migrating critical data.
    

---

# **Conclusion: 🎃**

Migrating an S3 bucket to another AWS account is simple when you know the steps. Share the bucket, copy the data, verify, and done! Follow this guide, and you’ll have your S3 bucket migrated in no time.

---

📬Found this guide helpful? Share it with your team or drop a comment below with your questions. For more AWS tips, subscribe and stay tuned!

#getintokube #getintokubeblogs
