Adding default sets of topics, categories and users to a new Discourse

In this way, you lose the time axis. Your default topic may looks out of date.

I guess your case is highly customized given different time. But the previous data doesn’t need to change since they will be archived just like Moodle.

I would suggest two ways:

  • If your data doesn’t evolved rapidly and it can be deduced from default site settings, you can go with a plugin. In this plugin, several seed_data can be registered (it’s the way to override admin start guide for plugin authors) as well as a lib task. Later on, you invoked this lib task.
  • While the previous may not be that customizable, you can however make use of a rake task. Visiting a HTTP url (securely), downloading and commit all changes. Basically everything you can do in the console can be done by rake task.

It’s been quite easy to invoke the rake task for Discourse Docker. Running rake in custom commands and you are good to go. In both case, you have to protect the rake task running twice which might fit your case. This can be achieved by a timestamp parameter. (Well, I don’t have an good idea now)

Besides, you have every rights to generate an admin API by rake apikey:get and use it whatever you want. Though you still need to use custom commands to trigger the rake task and collect it (securely).

Basically, depends on what you need to do :slight_smile:

「いいね!」 1