Can Discourse migrate what is already in in locally when it is connected to S3 storage?

Discourse 的备份是一个 zip 压缩包。

解压后,一个是数据库,另一个是上传文件(uploads)。

使用 S3 存储后,此 Uploads 将不会出现在备份文件中,而是存储在对象存储中。

每次备份都只会备份数据库除非开启了某个设置选项,允许备份 S3 存储的 Uploads。

:red_question_mark: 提问环节 :red_question_mark:

请问,如果我此时使用了本地存储一段时间了,备份文件里面的 Uploads 已经很庞大了

我能否手动将备份文件里的 Uploads 覆盖 >>>>>>>>>>> 到 S3 存储里的 Uploads

对于原本已经被话题引用的图片文件,它们能正常显示吗?

(Discourse 对于图片存储方式是通过随机的名字来区分的,例如 upload://ob9K7RhMbch2b2oTnJNi0bYCNPi.png


Discourse’s backup is a zip archive.

After unzipping, one is the database, and the other is the upload files (uploads).

When using S3 storage, this Uploads will not appear in the backup file, but will be stored in the object storage.

Each backup only backs up the database, unless some setting option is turned on to allow backups of S3 stored Uploads.

:red_question_mark: Question time :red_question_mark:

May I ask if I have used local storage for a while at this point, the Uploads inside the backup file are already huge?

Can I manually overwrite >>>>>>>>>> the Uploads from the backup file to the Uploads in the S3 storage?

Do they display properly for image files that were originally already referenced in the topic?

(Discourse is differentiated by random names for how images are stored, e.g. upload://ob9K7RhMbch2b2oTnJNi0bYCNPi.png)

前端是根据cooked的内容来获取图片地址的,也就是说如果你只是把文件复制到了S3里,浏览器依然会尝试冲本地存储的URL里下载图片

要把本地存储的内容迁移到S3,最简单的方法是执行迁移脚本rake uploads:migrate_to_s3


The frontend retrieves images based on the cooked content, meaning that if you only copy the files to S3, the browser will still attempt to fetch images from the local storage URLs.

The simplest way to migrate content from local storage to S3 is to run the migration script rake uploads:migrate_to_s3.

3 个赞

rake uploads:migrate_to_s3 是什么?

您可以参考