كيفية نقل التحميلات القديمة إلى 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 إعجابات

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?

لقد قمت للتو بتحويل مثيلي من التحميلات المحلية إلى تحميلات S3، ولم أستطع بأي حال من الأحوال معرفة كيفية تشغيل أداة ترحيل S3. وحرصًا على أي شخص آخر قد يزور هذا الموضوع، سأوجز الخطوات المطلوبة هنا.

  1. قم بتفعيل التحميلات على S3 من خلال واجهة المسؤول، وقم بإعداد جميع مفاتيح وإعدادات S3 المطلوبة بحيث تُرسل التحميلات الجديدة إلى S3.
  2. أضف متغيرات البيئة المطلوبة DISCOURSE_S3_ إلى قسم البيئة في ملف app.yml.
    مثال:
  DISCOURSE_S3_BUCKET: اسم-الوعاء-الخاص-بك
  DISCOURSE_S3_REGION: منطقة-وعاء-S3-الخاص-بك
  DISCOURSE_S3_ACCESS_KEY_ID: معرف-مفتاح-الوصول-الخاص-بـ-S3
  DISCOURSE_S3_SECRET_ACCESS_KEY: مفتاح-الوصول-الخاص-السري-الخاص-بـ-S3
  1. أعد بناء التطبيق باستخدام الأمر ./launcher rebuild app.
  2. ادخل إلى التطبيق باستخدام الأمر ./launcher enter app.
  3. شغّل الأمر rails uploads:migrate_to_s3 من داخل حاوية Docker.

في البداية، حاولت تشغيل الأمر باستخدام ./launcher run app rails uploads:migrate_to_s3، لكنه لم يتمكن من العثور على المهمة.

4 إعجابات