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

**URL:** <https://meta.discourse.org/t/adding-default-sets-of-topics-categories-and-users-to-a-new-discourse/42733>\
**Category:** Development\
**Created:** [18 Abril, 2016 16:47 UTC](https://meta.discourse.org/t/adding-default-sets-of-topics-categories-and-users-to-a-new-discourse/42733 "2016-04-18T16:47:38Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![fantasticfears](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fantasticfears/32/119608_2.png) [@fantasticfears](https://meta.discourse.org/u/fantasticfears)\
**Post date:** [18 Abril, 2016 19:34 UTC](https://meta.discourse.org/t/adding-default-sets-of-topics-categories-and-users-to-a-new-discourse/42733/5 "2016-04-18T19:34:52Z")

</div>

> [@pfaffman](#):
>
> I think that perhaps the easiest/best way to do this is to set up a fresh install, set stuff up like I want it, and back that up. Those who want to use my system would do a fresh install and restore my database.

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

> [@pfaffman](#):
>
> each course will have a set of categories/subcategories with appropriate permissions;  
> there need to be additional topics in the Staff category about how to organize things  
> Badges for submitting assignments and getting instructor approval  
> I want to tweak the language in some of the default staff posts for people who don’t know what system administration is

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 🙂

---

_[View the full topic](https://meta.discourse.org/t/adding-default-sets-of-topics-categories-and-users-to-a-new-discourse/42733)._
