Rake migrate_to_s3 errors

AI-generated summary

In a discussion titled ‘Rake migrate_to_s3 errors’ under Self-hosting support with tag s3, markersocial reports failing to migrate a large Discourse forum to S3 despite success with a smaller one, citing errors like missing uploads and posts not remapped to S3 URLs. They mention considering an off-road workaround shared by @marcozambi but prefer an official solution. Bathinda confirms facing the same issue and links to their own topic. markersocial replies that they didn’t find a fix and upgraded their server instead, still hoping to complete the migration. gerhard suggests the issue — specifically ‘Some uploads were not migrated to the new scheme’ — may be resolved in the latest beta, noting the rake task should handle schema migration if not already done.

So I tested the waters migrating a smaller Discourse forum to s3 successfully. I’m having issues migrating this larger forum however. I might end up resorting to using this method shared by @marcozambi Migrate_to_s3 task fails for placing too many requests - #2 by marcozambi, would rather not take the off-road path if possible though. :desert:

Anyone experience this before or have any ideas for solutions? Errors are below:

root@server-app:/var/www/discourse# rails c
[1] pry(main)> SiteSetting.migrate_to_new_scheme = true
=> true
[2] pry(main)> Jobs::MigrateUploadScheme.new.execute(nil)
=> nil
[3] pry(main)> exit

root@server-app:/var/www/discourse# rake uploads:migrate_to_s3
Checking if default already migrated...
50389 of 50511 uploads are not migrated to S3. S3 migration failed for db 'default'.
223765 posts are not remapped to new S3 upload URL. S3 migration failed for db 'default'.
Looking for missing uploads on: default

85 post uploads are missing.

82 uploads are missing.
76 of 2757605 posts are affected.

rake posts:missing_uploads identified 76 issues. S3 migration failed for db 'default'.
2693898 posts still require rebaking and will be rebaked during regular job
To speed up migrations of posts we recommend you run 'rake posts:rebake_uncooked_posts'
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)

Did you find the solution to this problem. Same problem being faced by me.
Pls guide.
my topic.

Sorry for the late reply! Unfortunately no, I didn’t find a solution so I ended up getting a larger server instead. I definitely would like to make the migration though. Did you have any luck?

That particular problem should be solved in the latest beta. The rake task migrates uploads to the new schema if it hasn’t happened yet.