Migrate to minio

I configured minio as image upload storage, it works well for new uploads, but I can’t migrate olds into that.

root@9c9267547230:/var/www/discourse# rake uploads:migrate_to_s3
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)

when I execute Jobs::MigrateUploadScheme.new.execute(nil) first time, it takes several hours and returned some exception, but seems finally success.

I execute it second time, it returns an empty array [].

and then I try to rake uploads:migrate_to_s3 again, it still says Some uploads were not migrated to the new scheme.

3 إعجابات

they’re site icons.

This is a known issue, already reported in the following topic:

It’s been a long time since it was promised to be fixed. However unfortunately it’s not fixed yet.

إعجابَين (2)

is there any known work-around solution?

I’m currently having a similar problem with Spaces.

3 إعجابات

I think It should be possible to manually transfer upload files from local to minio by minio client (mc). Then update links by a rake task. However I didn’t try it cause I cant risk it on my community.

In your case if its only a handful of site icons, maybe just upload them manually and update links in your dashboard.

إعجابَين (2)

So this is ultimately CORS related as well, @pfaffman?

إعجاب واحد (1)

The problem that I think he was referring to is that migrate_to_s3 won’t run unless everything has been changed to the new scheme but the default/stock images are in the old scheme. And the process that updates them didn’t touch the stock images. (and if you run an update they get recreated)

إعجاب واحد (1)

Can you update to latest and run the rake task again?

I fixed the rake task to only check for uploads made by users otherwise it wouldn’t run.

إعجابَين (2)

Oooh! . by_users! I didn’t know about that one. I’ll try to have a look, though it seems pretty clear they should fix it.

I suspect my task is still running.

That’s because it’s new-ish. Was added in

3 إعجابات

ooh sorry I have already migrated it manually and can’t do this again.

إعجاب واحد (1)