# 迁移到 S3 以解决 Digital Ocean Spaces 的问题

**URL:** https://meta.discourse.org/t/migrate-to-s3-for-digital-ocean-spaces-woes/109662
**Category:** Self-hosting
**Tags:** s3
**Created:** [2019年二月20日 15:54 UTC](https://meta.discourse.org/t/migrate-to-s3-for-digital-ocean-spaces-woes/109662 "2019-02-20T15:54:27Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![rishabh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rishabh/32/179446_2.png) [@rishabh](https://meta.discourse.org/u/rishabh)
#### Post date: [2019年二月21日 10:41 UTC](https://meta.discourse.org/t/migrate-to-s3-for-digital-ocean-spaces-woes/109662/6 "2019-02-21T10:41:11Z")

</div>

> [@pfaffman](#):
>
> The latest `uploads.rb` cranks up `Aws::S3` with just a few environment variables (and not those required for Digital Ocean spaces).

I’ve fixed this in:

[https://github.com/discourse/discourse/commit/e69634ec3aa594abd3c2d1057dcf1f65d09c48f5](https://github.com/discourse/discourse/commit/e69634ec3aa594abd3c2d1057dcf1f65d09c48f5)

For the GlobalSetting issue, can you try running the command like this to test if your config is alright?

```plaintext
DISCOURSE_S3_ACCESS_KEY_ID="" \
DISCOURSE_S3_SECRET_ACCESS_KEY="" \
DISCOURSE_S3_REGION="us-east-1" \
DISCOURSE_S3_BUCKET="uploadbucket" \
DISCOURSE_S3_CDN_URL="https://xyz.com" \
DRY_RUN=1 rake uploads:migrate_to_s3

```

_Please make sure that you’ve set the correct DigitalOcean endpoint in `SiteSetting.s3_endpoint` and that you’ve set DRY\_RUN=0 to make the actual migration happen._

---

_[View the full topic](https://meta.discourse.org/t/migrate-to-s3-for-digital-ocean-spaces-woes/109662)._
