I want to migrate my files from s3 back to local. I’m manually transferring all files from s3 to uploads folder. Then should be changing the base url of upload links, back to forum base url, sufficient to do the job done?
Why aren’t you using the built-in rake task? afaik it’s called uploads:migrate_from_s3
cd /var/discourse
./launcher enter app
rake uploads:migrate_from_s3
Then disable the enable s3 uploads site setting:
And finally rebake:
rake posts:rebake
Because my s3 is minio and I’m not sure if this function is compatible with it or not.
I tried this and after it was done, I didnt see any change in uploads. Still uploads are served from s3. btw the rake task was wierd to me. It ended so fast while I have thousnds of s3 uploads. It shouldve taked a while.
I have all my uploads transferred to local manually. Is there something that I can do to change all of the links in database and posts directly? I don’t need to use this rake task.
Did you figure this out? I’m also looking to migrate all assets (everything except backups) from S3 back to the local. Is there an easy way to do this?
I too am looking for similar option. But I read somewhere on this very site, that for this to work correctly, some big problems are to be sorted first. So, for the time being, they recommend not to shift S3 to local.
Though I’m also anxiously waiting for the solution to this problem.
There is a hidden site setting called something like “download S3 uploads to local on backup”. I think you can use that and restore to another server (or maybe your server if you change settings with shadowed site settings in environment variables). This is what cdck does when you close an account and I’ve never had trouble restoring one of their backups.
I did commanded that setting in Rails console SiteSetting.include_s3_uploads_in_backups = true. But it still didn’t (seem to) have any effect. The backup still was the same size (approx 375 MB, even when my uploads are around 700 MB to 1GB).
If by ‘Shadowed site settings’ you mean all the S3 site settings in Disco Web UI, then I do have all those settings filled in those fields.
I’m also looking to migrate my uploads from S3 to local (separate VPS). Is there a documented procedure for this?
Not really. I’d try using the setting I described above
Is there a way to find these hidden settings?
The one that you might need in context of this discussion is mentioned above. You can see them all in site_settings.yml in the Discourse source.
مهمة rake هذه لم تعد متوفرة في 2.9.0 BETA 8
هل لدى أي شخص أفكار حول كيفية الترحيل من S3 إلى المحلي؟
يمكنك تفعيل إعداد الموقع المخفي الذي يسمى شيئًا مثل download_s3_with_backups (هذا ليس صحيحًا تمامًا ولكني لا أستطيع العثور عليه على هاتفي الآن) ثم استعادة هذا النسخ الاحتياطي. هذا ما يحدث عند مغادرة استضافة cdck، وهو يعمل. قد تحتاج إلى الاستعادة إلى خادم مختلف (وستفعل ذلك على أي حال للاختبار).
تعديل: شكرًا @Benjamin_D! إنه include_s3_uploads_in_backups
أليست هذه الخيار متاحًا في صفحة الإعدادات في عناصر تحكم موقع المسؤول Backup صفحة الإعدادات؟ أليس هذا هو عكس تنزيل ملفات S3؟
لا.
backup_with_uploads ليست مثل include_s3_uploads_in_backups. أحدهما يتضمن الملفات المحلية في النسخ الاحتياطي. الآخر يقوم بتنزيل كل ملف من S3 في كل مرة تقوم فيها بعمل نسخة احتياطية. والهدف الكامل من S3 هو أنك لا تحتاج إلى عمل نسخ احتياطية منه.
إذًا، هذا يشمل الملفات المحلية عند النسخ الاحتياطي إلى S3
هذا يقوم بتنزيل الملفات من مخزن S3 لتضمينها في النسخة الاحتياطية (والتي يمكن أن تكون محلية أو على S3)
أحاول فهم الخطوات الصحيحة هنا، الهدف هو ترحيل جميع الملفات من S3 إلى المحلية، لذا إذا فهمت ما تقوله:
- تمكين
backup_with_uploadsمن وحدة تحكم Rails - إنشاء نسخة احتياطية (إما محلية أو على S3)
- استعادة باستخدام النسخة الاحتياطية
- تعطيل
backup_with_uploadsمن وحدة تحكم Rails
هل هذا صحيح؟
إذًا، ما هو النهج الأفضل فعليًا للانتقال من S3 إلى المحلي؟ ![]()
- نقل الملفات يدويًا (مجلدات optimized/original) وإجراء إعادة خبز بعد تعطيل خيار S3 من Discourse؟
- استخدام خيار المسؤول
download_s3_with_backups، وتنزيل وفك ضغط هذه الملفات؟ rake uploads:migrate_from_s3؟
