Migrating uploads to S3 for 'default'...
Some uploads were not migrated to the new scheme. Please run these commands in the rails console
SiteSetting.migrate_to_new_scheme = true
Jobs::MigrateUploadScheme.new.execute(nil)
I think this is because I have setup volumes in digitalocean and moved all uploads to the volumes disk. What should I do to make the migration work?
Thanks.
rails c
SiteSetting.migrate_to_new_scheme = true
Jobs::MigrateUploadScheme.new.execute(nil)
It is very slowly migrating. It copies one image every 3 seconds⊠but itâs doing it I think.
Update: every now and then it goes in deadlock:
PG::TRDeadlockDetected: ERROR: deadlock detected
DETAIL: Process 13101 waits for ShareLock on transaction 42733666; blocked by process 15775.
Process 15775 waits for ShareLock on transaction 42733664; blocked by process 13101.
HINT: See server log for query details.
CONTEXT: while updating tuple (7962,3) in relation "posts"
I reissue the commands and it continues where it left, at least if doesnât start all over, this is cool!
Ok, after moving all tombstone images to the uploads directory, some images reapperared. But many old images havenât been migrated. I donât know how the uploads:migrate_to_s3 script works.
Since I want to delete all the uploads directory, I want to migrate all files to S3. Why some files have not been migrated?
I think the problem is with the migrate_to_s3 script, it doesnât pick up those images. Is there a chance to update the script and make it work?
Thank you.
After my last update from git it asks for env vars:
Migrating uploads to S3 for 'default'...
Please provide the following environment variables
- DISCOURSE_S3_BUCKET
- DISCOURSE_S3_REGION
- DISCOURSE_S3_ACCESS_KEY_ID
- DISCOURSE_S3_SECRET_ACCESS_KEY
It always asks for the env variables, whatever I do!
I have S3 in my site settings, so I donât know why this doenât work:
unless GlobalSetting.use_s3?
puts <<~TEXT
Please provide the following environment variables
- DISCOURSE_S3_BUCKET
- DISCOURSE_S3_REGION
- DISCOURSE_S3_ACCESS_KEY_ID
- DISCOURSE_S3_SECRET_ACCESS_KEY
TEXT
exit 2
end
As written before, the error message appears just the same. Let me recap to be clear:
S3 is configured in the site settings and it works. Uploads go to my S3 bucket (and backups too)
Some previous uploads have been successfully migrated using the script. The script also rebaked the posts so itâs all good. I did a manual rebake just in case. It worked without asking for the env vars, but it worked partially.
Some other uploads did not migrate. I tried running the script multiple times but the uploads were not picked up by the script. Thinking it was a bug in the script I went to github and found a newer version of the script. Launching the newer version it asks the env vars, even if I provide them in the command line or if I set them in the shell. No way.