# Migrate old uploads to minio

**URL:** https://meta.discourse.org/t/migrate-old-uploads-to-minio/134780
**Category:** Self-hosting
**Tags:** s3
**Created:** [November 30, 2019, 10:28pm UTC](https://meta.discourse.org/t/migrate-old-uploads-to-minio/134780 "2019-11-30T22:28:20Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![hosna](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hosna/32/99969_2.png) [@hosna](https://meta.discourse.org/u/hosna)
#### Post date: [November 30, 2019, 10:28pm UTC](https://meta.discourse.org/t/migrate-old-uploads-to-minio/134780/1 "2019-11-30T22:28:20Z")

</div>

I’m doing somthing like this:

`DISCOURSE_S3_BUCKET="abc" DISCOURSE_S3_REGION="minio" DISCOURSE_S3_ACCESS_KEY_ID="abc" DISCOURSE_S3_SECRET_ACCESS_KEY="abc" DISCOURSE_S3_ENDPOINT="my minio endpoint" rake uploads:migrate_to_s3`

However I get the following error:

Please provide the ‘DISCOURSE\_S3\_CDN\_URL’ environment variable

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [December 1, 2019, 5:16am UTC](https://meta.discourse.org/t/migrate-old-uploads-to-minio/134780/2 "2019-12-01T05:16:49Z")

</div>

If you don’t want to configure a CDN then you can just put the prefix for the bucket name, I think.

Minio isn’t supported and might not work.

---

<div class="post-metadata">

### Author: ![hosna](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hosna/32/99969_2.png) [@hosna](https://meta.discourse.org/u/hosna)
#### Post date: [December 1, 2019, 7:04am UTC](https://meta.discourse.org/t/migrate-old-uploads-to-minio/134780/3 "2019-12-01T07:04:21Z")

</div>

still I get that message

```plaintext
DISCOURSE_S3_BUCKET="test" DISCOURSE_S3_REGION="minio" DISCOURSE_S3_ACCESS_KEY_ID="xxx" DISCOURSE_S3_SECRET_ACCESS_KEY="xxx" DISCOURSE_S3_ENDPOINT="https://myendpoint.com" DISCOURSE_S3_CDN_URL="test" rake uploads:migrate_to_s3
Checking if default already migrated...
10 of 25 uploads are not migrated to S3. S3 migration failed for db 'default'.
2 posts are not remapped to new S3 upload URL. S3 migration failed for db 'default'.
Looking for missing uploads on: default

0 post uploads are missing.

No posts require rebaking
Migrating uploads to S3 for 'default'...
Please provide the 'DISCOURSE_S3_CDN_URL' environment variable
```

---

<div class="post-metadata">

### Author: ![hosna](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hosna/32/99969_2.png) [@hosna](https://meta.discourse.org/u/hosna)
#### Post date: [December 10, 2019, 4:33pm UTC](https://meta.discourse.org/t/migrate-old-uploads-to-minio/134780/4 "2019-12-10T16:33:21Z")

</div>

> [@pfaffman](#):
>
> Minio isn’t supported and might not work.

I think previously you were able to migrate to digital ocean spaces. I dont know If minio and spaces are the same, but if you are interested and give it a try and support minio on discourse, I can sponsor the job.

---

<div class="post-metadata">

### Author: ![Bathinda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bathinda/32/135888_2.png) [@Bathinda](https://meta.discourse.org/u/Bathinda)
#### Post date: [December 20, 2019, 12:44pm UTC](https://meta.discourse.org/t/migrate-old-uploads-to-minio/134780/5 "2019-12-20T12:44:25Z")

</div>

> [@hosna](#):
>
> DISCOURSE\_S3\_ENDPOINT=“my minio endpoint”

In place of the quoted words here above, try using your full CDN url, something like this: "DISCOURSE\_S3\_CDN\_URL=“https://bucket\_name.s3.ap-south-1.amazonaws.com/folder\_name\_if\_any”. Also you should replace the word ‘ap-south-1’ with your actual [amazon region name](https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region).

Disclaimer: My suggestion is only for Amazon S3 users.
