Come migrare i vecchi upload su S3?

I now have all new uploads going straight to S3 but now I’d like to move all previous uploads to S3 as well. Is there a How To for this?

I searched the forums and found bits and pieces but not a step by step guide. I was unable to figure it out so far.

You should be able to use the uploads:migrate_to_s3 rake command. This would migrate your local files to the configured S3 bucket.

3 Mi Piace

Hi guys,

I’m in the same boat. But i already moved the /uploads/ folder to it’s new S3. Is there an alternative to uploads:migrate_to_s3 that only relinks but skips actual uploading?

Ho appena spostato la mia istanza da upload locali a S3 e non sono riuscito in nessun modo a far funzionare il migratore S3. Nell’interesse di chiunque altro visiti questo argomento, riassumerò qui i passaggi necessari.

  1. Abilita gli upload S3 nell’interfaccia di amministrazione e imposta tutte le chiavi e le impostazioni S3 richieste in modo che i nuovi upload vengano inviati a S3
  2. Aggiungi le variabili d’ambiente DISCOURSE_S3_ richieste alla sezione env di app.yml
    Esempio:
  DISCOURSE_S3_BUCKET: your-bucket-name
  DISCOURSE_S3_REGION: your-s3-bucket-region
  DISCOURSE_S3_ACCESS_KEY_ID: your-s3-access-key-id
  DISCOURSE_S3_SECRET_ACCESS_KEY: your-s3-secret-access-key
  1. Ricompila la tua app con ./launcher rebuild app
  2. Accedi all’app con ./launcher enter app
  3. Esegui rails uploads:migrate_to_s3 all’interno del contenitore Docker.

Inizialmente ho provato a eseguire il comando usando ./launcher run app rails uploads:migrate_to_s3, ma non è riuscito a trovare l’attività.

4 Mi Piace