# Migrating uploads from S3 to local

**URL:** https://meta.discourse.org/t/migrating-uploads-from-s3-to-local/163903
**Category:** Self-hosting
**Tags:** s3
**Created:** [September 13, 2020, 10:41pm UTC](https://meta.discourse.org/t/migrating-uploads-from-s3-to-local/163903 "2020-09-13T22:41:36Z")
**Posts on this page:** 1
**Showing post:** 29

<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: [June 20, 2024, 3:42pm UTC](https://meta.discourse.org/t/migrating-uploads-from-s3-to-local/163903/29 "2024-06-20T15:42:50Z")

</div>

> [@kuaza](#):
>
> it does not work for those using **cloudflare R2**

The documentation and your experience suggest that R2 is not supported, so you will need to resolve the problem some other way.

> [@Configure an S3 compatible object storage provider for uploads](https://meta.discourse.org/t/configure-an-s3-compatible-object-storage-provider-for-uploads/148916/1):
>
> ### Cloudflare
> 
> Cloudflare’s offering is incompatible. In testing, @fearlessfrog filed a ticket with Cloudflare and in December 2022 they said:
> 
> > [@](#):
> >
> > Files that you gzip are not currently handled correctly by R2. You have to upload uncompressed files. Cloudflare has transparent compression, they pick identity, gzip, or Brotli based on what the client can handle. This is a difference from S3.

I thought that it was working for me, but didnt’ test very carefully and haven’t used it beyond a trivial smoke test.

If the backup wont’ download the files from R2 then you’ll need to use some other tool to retreive the files from R2 and then push them to your new bucket and then update the database by hand (you can search for topics using the `remap` rake task, I think).

This is a complex process, so you’ll need to understand a good deal about R2, S3, and Discourse’s Uploads. It’ll likely be difficult to explain your exact issues with enough specificity that you can get a solution on a forum.

---

_[View the full topic](https://meta.discourse.org/t/migrating-uploads-from-s3-to-local/163903)._
