The container folder you are talking about is NOT the container.
The container is a Docker construct build and launched to run as a Docker container.
BTW, do not take this the wrong way, but do you understand what a Docker container is? It is perfectly OK if you don’t, BTW. Many people use Discourse daily and have not yet learned Docker container basics. It’s never too late to learn
Reference:
PS: @Pravi. I provided you the code to enter the container and change to the directory to where the config file are. Did you consider following that code I posted?
PS2: The rake task you are having trouble with (migrate_from_s3) can be found here:
One approach would be to look at your log file entries immediately before your error message, and see if you can locate the line (or lines) in the rake task file; and try to isolate what is causing your issue, exactly.
Solutions are normally the easy part. The hard part is discovering what the problem is.
You also a the full Discourse Ruby code for this rake task, above.
My apologies, but I have a lot of tasks to do as well, so I’m just trying to show you, at a high level, how to debug and the solve your own problems the same way most of us would go about it.
I am sorry for taking too much time of yours. One last time, I tried to migrate to S3 instead of migrate from, which gives me following error even though I have provided all the details of s3 storage in my admin panel. Please take a look if you are familiar with this error.
root@ip-172-31-7-247:/var/discourse# ./launcher enter app
root@ip-172-31-7-247-app:/var/www/discourse# rake uploads:migrate_to_s3
rake aborted!
FileStore::ToS3MigrationError: Please provide the following environment variables:
- DISCOURSE_S3_BUCKET
- DISCOURSE_S3_REGION
and either
- DISCOURSE_S3_ACCESS_KEY_ID
- DISCOURSE_S3_SECRET_ACCESS_KEY
or
- DISCOURSE_S3_USE_IAM_PROFILE
/var/www/discourse/lib/file_store/to_s3_migration.rb:38:in `s3_options_from_env'
/var/www/discourse/lib/tasks/uploads.rake:237:in `create_migration'
/var/www/discourse/lib/tasks/uploads.rake:245:in `migrate_to_s3'
/var/www/discourse/lib/tasks/uploads.rake:224:in `block in migrate_to_s3_all_sites'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rails_multisite-2.3.0/lib/rails_multisite/connection_management.rb:68:in `with_connection'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rails_multisite-2.3.0/lib/rails_multisite/connection_management.rb:78:in `each_connection'
/var/www/discourse/lib/tasks/uploads.rake:222:in `migrate_to_s3_all_sites'
/var/www/discourse/lib/tasks/uploads.rake:218:in `block in <main>'
/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)
Update:
I have added the all these DISCOURSE_S3_BUCKET, DISCOURSE_S3_REGION, DISCOURSE_S3_ACCESS_KEY_ID, DISCOURSE_S3_SECRET_ACCESS_KEY to app.yml and the above problem is solved. Now I am able to migrate to S3, but I cant migrate from S3. Its asking me to turn off S3 upload even though I have added DISCOURSE_USE_S3: false in my app.yml