# 将 S3 存储桶迁移到新的 S3 存储桶（兼容的服务）

**URL:** <https://meta.discourse.org/t/migrate-s3-bucket-to-new-s3-bucket-compatible-service/221900>\
**Category:** Support\
**Created:** [2022年三月24日 18:59 UTC](https://meta.discourse.org/t/migrate-s3-bucket-to-new-s3-bucket-compatible-service/221900 "2022-03-24T18:59:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![markersocial](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markersocial/32/170136_2.png) [@markersocial](https://meta.discourse.org/u/markersocial)\
**Post date:** [2022年三月24日 18:59 UTC](https://meta.discourse.org/t/migrate-s3-bucket-to-new-s3-bucket-compatible-service/221900/1 "2022-03-24T18:59:37Z")

</div>

是否有人成功地从 S3 迁移到另一个 S3 存储桶（即兼容服务上的存储桶）？

我正在考虑这个过程可能有效：

1. 停止 Discourse（./launcher stop app），以确保没有新的上传被处理
2. 使用 rclone 将现有的主存储桶迁移到新的主存储桶（也可选迁移备份存储桶）
3. 在 app.yml 中更新凭据、端点、存储桶名称等
4. 重建 Discourse
5. 更新 CDN 域以从新存储桶拉取

不确定这是否可行，或者我是否遗漏了什么，任何见解都将不胜感激。🙂

---

<div class="post-metadata">

**Author:** ![cocococosti](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cocococosti/32/231474_2.png) [@cocococosti](https://meta.discourse.org/u/cocococosti)\
**Post date:** [2022年三月31日 01:30 UTC](https://meta.discourse.org/t/migrate-s3-bucket-to-new-s3-bucket-compatible-service/221900/2 "2022-03-31T01:30:17Z")

</div>

我从没试过，但这里有一些非常有用的讨论：

> [@How do I move my s3 upload bucket from one provider to another?](https://meta.discourse.org/t/how-do-i-move-my-s3-upload-bucket-from-one-provider-to-another/178484):
>
> I have setup my upload bucket originally on AWS, but I want to now use Linode. Setup went well and I can see that images are being uploaded to the Linode already. However, when I look at the old posts, they are still pointing to AWS. How can I move those images to Linode so that I can remove the bucket on AWS? Thanks!

> [@Moving from one S3 bucket to another](https://meta.discourse.org/t/moving-from-one-s3-bucket-to-another/184779):
>
> Continuing the discussion from [How do I move my s3 upload bucket from one provider to another?](https://meta.discourse.org/t/how-do-i-move-my-s3-upload-bucket-from-one-provider-to-another/178484/2): I’m trying to move from a GCP bucket to an AWS S3 bucket. The old system doesn’t use an S3 CDN (the guy who set it up didn’t really know what he was doing, apparently). I used s3cmd to sync the old GCP bucket to a local filesytem, then used it again to push the assets to the new S3 bucket. The system is now properly configured with S3 and site CDNs as described in [Using Object Storage for Uploads (S…](https://meta.discourse.org/t/using-object-storage-for-uploads-s3-clones/148916)

> [@Changing s3 bucket for uploads](https://meta.discourse.org/t/changing-s3-bucket-for-uploads/188553/5):
>
> That would be very helpful, tyvm!
