# Stop using Amazon s3 for uploads

**URL:** https://meta.discourse.org/t/stop-using-amazon-s3-for-uploads/107286
**Category:** Support
**Created:** [January 23, 2019, 1:26pm UTC](https://meta.discourse.org/t/stop-using-amazon-s3-for-uploads/107286 "2019-01-23T13:26:23Z")
**Posts on this page:** 1
**Showing post:** 41

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [May 5, 2021, 3:55pm UTC](https://meta.discourse.org/t/stop-using-amazon-s3-for-uploads/107286/41 "2021-05-05T15:55:09Z")

</div>

> [@keven](#):
>
> Someone smarter than me about discourse should put together a fool-proof tutorial on how this should be accomplished.

Not smarter than you but just went through it - and made it out with @Pravi’s help.

## The steps that you need to take to move from S3 upload back to the vanilla state

This is not super-easy - take great care with the text and links as it will be a right mess to tidy up if it goes wrong. But it is very doable.

### Step 1 - Copy the files from your S3 bucket to the `public/uploads/default’ folder

First, install [AWS CLI](https://aws.amazon.com/cli/) inside the app container

```plaintext
cd /var/discourse
./launcher enter app
sudo apt install awscli

```

Configure aws with your S3 ID and password (usually straightforward)

```plaintext
aws configure

```

Then use `aws` to copy all the content of the bucket into `public/uploads/default/`

```plaintext
aws s3 sync s3://my-bucket-name/ public/uploads/default/

```

### Step 2 - Remap the S3 URL

This is easiest by finding an image on your forum and inspecting the URL. You want every bit until the actual filename (including the last `/`):

```plaintext
discourse remap //the-long-url-in-your-images-until-the-filename /uploads/default/

```

### Step 3 - Rebake the posts and rebuild the app:

```plaintext
rake posts:rebake
exit
./launcher rebuild app

```

### Step 4 - Turn off S3

1. Switch off S3 uploads in the settings (or in your app.yml if you set it up that way). If you have been using a CDN, then remove the link to it from the setting too (otherwise it doesn’t actually turn off).
2. Turn off your container. I did this by moving the content to a new container as a backup as an initial step.

Whew! Done. So far I haven’t encountered any issues. Go and test it out!

---

_[View the full topic](https://meta.discourse.org/t/stop-using-amazon-s3-for-uploads/107286)._
