仅备份站点设置

I would like to know the possibility of backing up Only Site Settings, just as opposite of what was asked here

The purpose is to replicate forums for different clients. If I can replicate settings, its easy to proceed with different categories, topics & users.

Please advise.

PS: I couldn’t understand by reading this

2 个赞

I think @zogstrip suggested entering the forum database you want to replicate (via SSH), clone the site_settings table into that database and replace that particular table in each new site you’re going to create.

4 个赞

I believe @techapj has expressed interest in this feature but we do not have it yet.

7 个赞

Alright.

So, I need to install Discourse as usual and take this step to replicate the settings. Will the instance version different make any conflicts here?

If we have to get the forum logo to new one, we will have to re-upload this, I suppose. Am I right?

Save https://yoursite/admin/site_settings.json. Use GitHub - pfaffman/discourse-settings-uploader: Install a Discourse settings JSON file to a site to upload them.

To install these settings to another site

Do this:

./discourse-settings-uploader HOSTURL API_KEY API_USER SETTINGS_FILE

For example:

./discourse-settings-uploader https://discourse.example.com d35989078a system site_settings.json

One caveat: It uploads only settings that are marked as changed. This means that if there’s some setting that’s changed on the site you’ve uploaded that you want to restore to default with the script it won’t work. The solution is to edit the JSON file so that the default value there doesn’t match the value you want to set.

Now what’s needed is a way to easily download all themes and then upload them. Uploading
a set of files shouldn’t be hard to do. Downloading themes by hand could be tedious, so some automated way to get all of them would be nice.

16 个赞

This sounds good. Will try this method next time I create a new forum.

I hope Discourse version difference will not make any issue, however I do update forums on regular basis… :slight_smile:

1 个赞

As long as the setting is available it will be set. Settings that don’t exists can’t get set, but make only that it doesn’t get set. For example, if you have a plugin installed on the system your are copying from its settings exist only if the target system has the plugin as well. When that happens an error is presented for each unavailable setting.

4 个赞

哦,这真是一个能救命的功能。

1 个赞

参见此处:Administrative Bulk Operations

6 个赞

如果你们能添加一个选项,将当前站点设置导出/备份到文件中,然后允许新的论坛站点导入该文件并应用相同的站点设置,那就太棒了。有人能实现这个功能吗?这非常有用,因为我希望能完整克隆我的站点数据和设置。

如果我想完整克隆当前的论坛,包括用户数据、主题、帖子、图片,以及 Discourse 管理员和插件的现有配置,我有哪些可行的方案?有人能指导我吗?@pfaffman

目前我能保存的只有 app.yml 文件和包含 shared 子目录的 discourse 文件夹,我认为 shared 目录中包含了所有数据库和用户上传的文件?

2 个赞

上述已描述了两种实现方法。

创建新论坛。备份当前论坛。将该备份恢复到新论坛。如果两个论坛使用相同的 S3 存储桶进行备份,可以节省一些步骤。

1 个赞

感谢您的快速回复,

创建一个新论坛。备份您当前的论坛。将该备份恢复到新论坛。如果两个论坛使用相同的 S3 存储桶进行备份,您可以节省一些步骤。

为什么我只需要手动备份站点设置?上述方法不是已经备份了所有插件设置、站点设置、图片/上传内容、数据库、帖子、主题等吗?

如果我按照这三个步骤操作,我的站点导出是否能提供站点/插件设置以及数据库和文件上传的完整备份?

  1. 创建一个新论坛。
  2. 通过访问管理 UI 仪表板并进入备份部分来备份当前论坛(不是在命令行中,对吗?)。
  3. 将我在步骤 2 中获得的这个新备份恢复,并插入到我在步骤 1 中创建的新论坛中。
  4. 我还没有任何用于备份的存储桶,我的论坛只是托管在 DigitalOcean 的 Droplet 上,并且仅位于服务器上的 var/discourse/shared 目录中。但我不明白为什么我的 Discourse Docker 的 yml 文件位于 /www/discourse 中。我不理解为什么所有 Discourse 文件都被分散在这两个位于不同路径的文件夹中?

请确认。

此主题已在 2335 天后自动关闭。不再允许回复。