# Migrating uploads to S3 for 'default'... rake aborted!

**URL:** https://meta.discourse.org/t/migrating-uploads-to-s3-for-default-rake-aborted/144033
**Category:** Self-hosting
**Tags:** s3
**Created:** [March 12, 2020, 11:08am UTC](https://meta.discourse.org/t/migrating-uploads-to-s3-for-default-rake-aborted/144033 "2020-03-12T11:08:34Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![eextra](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eextra/32/170266_2.png) [@eextra](https://meta.discourse.org/u/eextra)
#### Post date: [March 12, 2020, 11:08am UTC](https://meta.discourse.org/t/migrating-uploads-to-s3-for-default-rake-aborted/144033/1 "2020-03-12T11:08:34Z")

</div>

> NameError: uninitialized constant FileStore::ToS3Migration::Aws

I set the bucket according to the manual. Then I typed in the console but I can’t move the images. Why this bug ?  
i put (app:/var/www/discourse# : )

```
DISCOURSE_S3_BUCKET=new-bucket \
DISCOURSE_S3_REGION=EU_Frankfurt \
DISCOURSE_S3_ACCESS_KEY_ID=dsadadassdadaIdsadY4 \
DISCOURSE_S3_SECRET_ACCESS_KEY=xyss1dsMtdsakcmjxBVsg1xsadaX \
rake uploads:migrate_to_s3

```

---

<div class="post-metadata">

### Author: ![eextra](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eextra/32/170266_2.png) [@eextra](https://meta.discourse.org/u/eextra)
#### Post date: [March 17, 2020, 2:11pm UTC](https://meta.discourse.org/t/migrating-uploads-to-s3-for-default-rake-aborted/144033/2 "2020-03-17T14:11:26Z")

</div>

whether it’s a bug or maybe I misspelled something ?

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [March 17, 2020, 2:21pm UTC](https://meta.discourse.org/t/migrating-uploads-to-s3-for-default-rake-aborted/144033/3 "2020-03-17T14:21:36Z")

</div>

> [@eextra](#):
>
> DISCOURSE\_S3\_REGION=EU\_Frankfurt

Try `eu-central-1` — see [AWS service endpoints - AWS General Reference](https://docs.aws.amazon.com/general/latest/gr/rande.html) for a list of regions.

---

<div class="post-metadata">

### Author: ![eextra](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eextra/32/170266_2.png) [@eextra](https://meta.discourse.org/u/eextra)
#### Post date: [March 19, 2020, 9:56pm UTC](https://meta.discourse.org/t/migrating-uploads-to-s3-for-default-rake-aborted/144033/5 "2020-03-19T21:56:18Z")

</div>

Unfortunately, it’s still a problem.

```plaintext
 > Migrating uploads to S3 for 'default'...
> rake aborted!
> NameError: uninitialized constant FileStore::ToS3Migration::Aws
> /var/www/discourse/lib/file_store/to_s3_migration.rb:159:in `migrate_to_s3'
> /var/www/discourse/lib/file_store/to_s3_migration.rb:61:in `migrate'
> /var/www/discourse/lib/tasks/uploads.rake:239:in `migrate_to_s3'
> /var/www/discourse/lib/tasks/uploads.rake:218:in `block in migrate_to_s3_all_sites'
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rails_multisite-2.1.1/lib/rails_multisite/connection_management.rb:64:in `with_connection'
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rails_multisite-2.1.1/lib/rails_multisite/connection_management.rb:74:in `each_connection'
> /var/www/discourse/lib/tasks/uploads.rake:216:in `migrate_to_s3_all_sites'
> /var/www/discourse/lib/tasks/uploads.rake:212:in `block in <top (required)>'
> /usr/local/bin/bundle:23:in `load'
> /usr/local/bin/bundle:23:in `<main>'
> Tasks: TOP => uploads:migrate_to_s3
> (See full trace by running task with --trace)

```

reading other threads and trying to get to the problem I noticed that I have only such settings in the file. There shouldn’t be any data for S3 ?

my discourse.conf:

```plaintext
> hostname = 'dasda' 
> smtp_user_name = 'dadsafa' 
> smtp_address = 'fasfaf' 
> db_socket = '/var/run/postgresql' 
> developer_emails = 'dasda@zyz.com' 
> smtp_port = '587' 
> smtp_password = 'zxc' 
> db_host = '' 
> db_port = '' 
> force_https = 'true'

```

---

<div class="post-metadata">

### Author: ![eextra](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eextra/32/170266_2.png) [@eextra](https://meta.discourse.org/u/eextra)
#### Post date: [March 21, 2020, 10:06pm UTC](https://meta.discourse.org/t/migrating-uploads-to-s3-for-default-rake-aborted/144033/6 "2020-03-21T22:06:04Z")

</div>

I set the app.yml data to s3 so that now `GlobalSetting.use_s3?` returns true

but I still can’t move the files to s3.
