--- title: "Copy a bucket to another account" description: "Copy every object from a bucket in one E2E account to a bucket in another, using the mc client and an admin access key on each side." content_type: "how-to" product: "object-storage" platform: "MyAccount" url: "/myaccount/object-storage/how-to/copy-a-bucket-to-another-account/" topic: ["use-with-other-products"] relationships: {"requires":["/myaccount/object-storage/how-to/connect-with-the-mc-client/"]} --- # Copy a bucket to another account Move a bucket's contents to another E2E account by copying every object across with an S3-compatible tool: the bucket itself stays where it is, but the data does not have to. This uses `mc`; see [Connect with the mc client](/myaccount/object-storage/how-to/connect-with-the-mc-client/) for installing it. ## Set up a bucket admin key on each side In the destination account, create a bucket to receive the data. On both the source and destination bucket, attach an access key with the **Bucket Admin** role; see [Generate an access key](/myaccount/object-storage/how-to/generate-an-access-key/). ## Add both buckets as mc aliases ```bash frame="none" mc alias set https://objectstore.e2enetworks.net mc alias set https://objectstore.e2enetworks.net ``` Use the Chennai endpoint from [S3 compatibility](/myaccount/object-storage/concepts/s3-compatibility/) instead for a bucket in that region. ## Copy the data ```bash frame="none" mc cp --recursive / / ``` `--recursive` copies every object, including anything under a folder-like prefix. `mc` shows a progress bar while it copies, and your prompt comes back when it is done. ## Check the copied bucket Count the objects on each side. Each command prints a single number. When the copy is complete, the two match: ```bash frame="none" mc ls --recursive / | wc -l mc ls --recursive / | wc -l ``` Do not delete anything from the source bucket until the numbers match; on a bucket without versioning, a deleted object cannot be brought back. See [Delete a bucket](/myaccount/object-storage/how-to/delete-a-bucket/) if you no longer need the source bucket at all.