نسخة احتياطية لقاعدة بيانات سطر الأوامر فقط

discourse backup creates a backup with uploads, regardless of the site setting that controls that. Is there a way to do a database only backup from the command line? It would be handy to be able do this for a number of reasons.

3 إعجابات
6 إعجابات

Thanks! I read enough here that I think I know and remember everything that’s been posted and sometimes forget to search. :man_shrugging:

I marked your post as the solution, but here’s the one-liner:

/var/discourse/launcher run app "echo 'BackupRestore::Backuper.new(Discourse.system_user.id, with_uploads: false).run' | rails c"
4 إعجابات

ملاحظة لنفسي للرجوع إليها في المستقبل:

# الدخول إلى حاوية دوكر، أو ./launcher enter <dockername>
docker exec -it <dockername> bash
# لا تنس تحديد قاعدة البيانات للمواقع المتعددة عند تشغيل وحدة تحكم rails
RAILS_DB=db_name rails c
# مراجعة الأمر:
BackupRestore::Backuper.new(Discourse.system_user.id, with_uploads: false)
# ثم تشغيل أمر النسخ الاحتياطي
BackupRestore::Backuper.new(Discourse.system_user.id, with_uploads: false).run

تم إغلاق هذا الموضوع تلقائيًا بعد 30 يومًا من آخر رد. لم تعد الردود الجديدة مسموح بها.