# Seeding a new forum by creating users and content

**URL:** https://meta.discourse.org/t/seeding-a-new-forum-by-creating-users-and-content/49345
**Category:** Support
**Created:** [August 28, 2016, 8:29pm UTC](https://meta.discourse.org/t/seeding-a-new-forum-by-creating-users-and-content/49345 "2016-08-28T20:29:52Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![joesed](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joesed/32/121563_2.png) [@joesed](https://meta.discourse.org/u/joesed)
#### Post date: [August 28, 2016, 8:29pm UTC](https://meta.discourse.org/t/seeding-a-new-forum-by-creating-users-and-content/49345/1 "2016-08-28T20:29:52Z")

</div>

Hi there

Discourse looks amazing. Wow! A big change from my old days using phpbb.

In the past, admittedly a long time ago now, I’ve had greater success starting new forums by initially seeding some content. A little social proof does wonders for engagement levels!

Would love to know whether it is possible to seed a new discourse forum. What I’d like to do is to create say 200 user accounts and roughly 1000 topics and replies before launching.

Is it possible to do this without having either 200 email addresses or 200 social accounts?

I’d like to add these users from the admin panel and log in to them occasionally to respond to new users.

Many thanks

Joe

---

<div class="post-metadata">

### Author: ![Sergiz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sergiz/32/60963_2.png) [@Sergiz](https://meta.discourse.org/u/Sergiz)
#### Post date: [August 28, 2016, 10:23pm UTC](https://meta.discourse.org/t/seeding-a-new-forum-by-creating-users-and-content/49345/2 "2016-08-28T22:23:46Z")

</div>

You can write yourself a script for that using API 😉

> [@Discourse REST API Documentation](https://meta.discourse.org/t/discourse-api-documentation/22706):
>
> Discourse API Please view the Discourse API Documentation site for detailed info: [https://docs.discourse.org](https://docs.discourse.org)information_source Authentication API requests must use HTTP header based authentication. Pass your Api-Key and Api-Username as HTTP headers. Authentication via query parameters or request body is not supported (this was removed in April 2020). Please see the example cURL request below. The only API endpoints that continue to support credentials in query parameters are requests to…

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [August 28, 2016, 10:44pm UTC](https://meta.discourse.org/t/seeding-a-new-forum-by-creating-users-and-content/49345/3 "2016-08-28T22:44:12Z")

</div>

> [@joesed](#):
>
> Is it possible to do this without having either 200 email addresses or 200 social accounts?

Seems disingenuous, but you can create multiple users with a single email account by using email addresses like this:

- `my.gmail.username@gmail.com`
- `my.gmail.username+user1@gmail.com`
- `my.gmail.username+joe@gmail.com`
- `my.gmail.username+funnyguy@gmail.com`
- `my.gmail.username+smartypants@gmail.com`
- `my.gmail.username+guyWeHate@gmail.com`

and so on. Most email systems support this convention.

There’s a bulk import feature, so you could create them all in a spreadsheet or whatever.

The API is a great took but you might also put the content in some database and write an importer to populate Discourse. See `vanilla.rb` and `vanilla_mysql.db` for examples. I just wrote an importer to import an image gallery. I thought it was a bad idea at first, because it would seem like an image gallery would be a good way to display an image gallery. But it turns out that the image gallery in Discourse is pretty freaking great.

---

<div class="post-metadata">

### Author: ![joesed](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joesed/32/121563_2.png) [@joesed](https://meta.discourse.org/u/joesed)
#### Post date: [August 29, 2016, 9:36am UTC](https://meta.discourse.org/t/seeding-a-new-forum-by-creating-users-and-content/49345/4 "2016-08-29T09:36:57Z")

</div>

Hi Sergiz and Jay

Thank you both for these suggestions.

I’m not a coder, so I’d probably look at doing things your way Jay.

Certainly not trying to be disingenuous, but I think it’s important to get the ball rolling with some posts. That way, others are more likely to join in.

Once again, many thanks.

Joe

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [August 29, 2016, 8:03pm UTC](https://meta.discourse.org/t/seeding-a-new-forum-by-creating-users-and-content/49345/5 "2016-08-29T20:03:48Z")

</div>

If you already have the 1000 posts and 200 usernames created in some machine-readable format it would probably be worth a few minutes to look at how the API works and/or paying someone to do it for you, but then, I’m a programmer, so I **would** think that. Or course, I’d rather spend 20 hours writing code than 10 copy-and-pasting, because what if you ever needed to do it again?

---

<div class="post-metadata">

### Author: ![HAWK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hawk/32/86627_2.png) [@HAWK](https://meta.discourse.org/u/HAWK)
#### Post date: [August 29, 2016, 11:37pm UTC](https://meta.discourse.org/t/seeding-a-new-forum-by-creating-users-and-content/49345/6 "2016-08-29T23:37:42Z")

</div>

> [@joesed](#):
>
> Certainly not trying to be disingenuous, but I think it’s important to get the ball rolling with some posts. That way, others are more likely to join in.

Hey Joe,  
You’re definitely right about social proof, but creating fake users is questionable practice and I’d strongly recommend against it, for the long term health of your community. There are more ethical ways of doing it (which won’t result in a backlash). If you want some advice around doing things differently, I’m happy to help.

[Here is further reading.](http://www.managingcommunities.com/2012/08/16/fake-users/)

---

<div class="post-metadata">

### Author: ![joesed](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joesed/32/121563_2.png) [@joesed](https://meta.discourse.org/u/joesed)
#### Post date: [August 30, 2016, 8:33pm UTC](https://meta.discourse.org/t/seeding-a-new-forum-by-creating-users-and-content/49345/7 "2016-08-30T20:33:33Z")

</div>

Hi @HAWK

I think you make a really great point.

I read your article and it makes a lot of sense. Developing a community the right way might take a bit longer but I think it will be better in the long run.

You have turned me around. I think my thinking is a little 2009.

Once again, many thanks

Joe

---

<div class="post-metadata">

### Author: ![HAWK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hawk/32/86627_2.png) [@HAWK](https://meta.discourse.org/u/HAWK)
#### Post date: [August 30, 2016, 9:22pm UTC](https://meta.discourse.org/t/seeding-a-new-forum-by-creating-users-and-content/49345/8 "2016-08-30T21:22:22Z")

</div>

Heh, awesome. Good on you. 🙂

> [@joesed](#):
>
> Developing a community the right way might take a bit longer but I think it will be better in the long run.  
> [/quote] Yup! If you want support or resources, I manage a free community about community building [here](https://experts.feverbee.com/). You’re welcome to join us.

---

<div class="post-metadata">

### Author: ![joesed](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joesed/32/121563_2.png) [@joesed](https://meta.discourse.org/u/joesed)
#### Post date: [August 31, 2016, 11:59pm UTC](https://meta.discourse.org/t/seeding-a-new-forum-by-creating-users-and-content/49345/9 "2016-08-31T23:59:59Z")

</div>

Hi @HAWK

Thanks so much for that. I will take you up on that offer to join your community as well if that’s okay. That’s really cool. Thanks!

And to everyone else who helped out, much respect. Thank you.

Cheers

Joe

---

<div class="post-metadata">

### Author: ![vas](https://avatars.discourse-cdn.com/v4/letter/v/ac91a4/32.png) [@vas](https://meta.discourse.org/u/vas)
#### Post date: [April 11, 2017, 6:04am UTC](https://meta.discourse.org/t/seeding-a-new-forum-by-creating-users-and-content/49345/10 "2017-04-11T06:04:55Z")

</div>

I don’t think this is possible as the posts section in api doesn’t have user id.

> **[Discourse API Docs](https://docs.discourse.org/#tag/Posts)**

How to tag response with an user? @pfaffman

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 19, 2017, 12:54pm UTC](https://meta.discourse.org/t/seeding-a-new-forum-by-creating-users-and-content/49345/11 "2017-04-19T12:54:40Z")

</div>

I cannot imagine that the API for posts doesn’t include the userid. Perhaps the documentation is wrong. There is a post about reverse engineering the API that might help,

---

<div class="post-metadata">

### Author: ![vas](https://avatars.discourse-cdn.com/v4/letter/v/ac91a4/32.png) [@vas](https://meta.discourse.org/u/vas)
#### Post date: [April 19, 2017, 2:15pm UTC](https://meta.discourse.org/t/seeding-a-new-forum-by-creating-users-and-content/49345/12 "2017-04-19T14:15:31Z")

</div>

Can you point out the link here? Will check it out!

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [April 19, 2017, 2:33pm UTC](https://meta.discourse.org/t/seeding-a-new-forum-by-creating-users-and-content/49345/13 "2017-04-19T14:33:22Z")

</div>

> [@pfaffman](#):
>
> I cannot imagine that the API for posts doesn’t include the userid.

I’m fairly certain it doesn’t. It takes it from the API userid and API key.

I just checked with one of my apps and I’m not passing a Username when creating a reply.  
[https://github.com/discourse/github-issues-to-discourse/blob/master/routes/api/discourse.js#L68-L73](https://github.com/discourse/github-issues-to-discourse/blob/master/routes/api/discourse.js#L68-L73)

Same with creating a topic:  
[https://github.com/discourse/github-issues-to-discourse/blob/master/lib/discourseCreateTopic/index.js](https://github.com/discourse/github-issues-to-discourse/blob/master/lib/discourseCreateTopic/index.js)

The only username it will have is based on the API username and key I provide.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 19, 2017, 2:58pm UTC](https://meta.discourse.org/t/seeding-a-new-forum-by-creating-users-and-content/49345/14 "2017-04-19T14:58:40Z")

</div>

> [@pfaffman](#):
>
> I cannot imagine that the API for posts doesn’t include the userid.

> [@cpradio](#):
>
> The only username it will have is based on the API username and key I provide.

Ha! Now I get it. I guess I need a better imagination. Thanks, @cpradio.

So it would seem that the way to create seed data with many users would be to modify an [import script](https://github.com/discourse/discourse/tree/master/script/import_scripts). It’s probably easiest to get your data into MBOX form and use the [mbox importer](https://github.com/discourse/discourse/blob/master/script/import_scripts/mbox.rb).

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [April 19, 2017, 3:36pm UTC](https://meta.discourse.org/t/seeding-a-new-forum-by-creating-users-and-content/49345/15 "2017-04-19T15:36:15Z")

</div>

It doesn’t seem to be in the API docs, but there is a `POST` endpoint for

```plaintext
/t/{id}/change-owner

```

which seems to take two parameters

```plaintext
{
post_ids[]:{post-id-to-change},
username:{user-to-change-ownership-to}
}

```

(I found that by watching my chrome dev tools while clicking the “change ownership” button on a post)

Maybe you use that to create posts using one user, then change their owner.

> [@vas](#):
>
> Can you point out the link here?

> [@Reverse engineer the Discourse API](https://meta.discourse.org/t/how-to-reverse-engineer-the-discourse-api/20576):
>
> Discourse is backed by a complete JSON api. Anything you can do on the site you can also do using the JSON api. The API is documented at [docs.discourse.org](https://docs.discourse.org). You can also use the [discourse\_api](https://github.com/discourse/discourse_api) Ruby gem as a client library. However, not every endpoint is documented. To determine how to do something with the JSON API here are some steps you can follow. Example: recategorize a topic. Go to a topic and start editing a category: Open Chrome dev tools, switch to the Network tab, select …

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [April 21, 2017, 7:54pm UTC](https://meta.discourse.org/t/seeding-a-new-forum-by-creating-users-and-content/49345/16 "2017-04-21T19:54:06Z")

</div>

Two notes:

- `post_ids[]` is a comma-separated array, you can do multiple
- doing this creates a revision on the post

It’s better to do an import script.

---

<div class="post-metadata">

### Author: ![Neeraj\_Saini](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neeraj_saini/32/129927_2.png) [@Neeraj\_Saini](https://meta.discourse.org/u/Neeraj_Saini)
#### Post date: [August 21, 2020, 9:42pm UTC](https://meta.discourse.org/t/seeding-a-new-forum-by-creating-users-and-content/49345/17 "2020-08-21T21:42:36Z")

</div>

anyone had luck creating this importer? I have the topics and answers in excel. would like to create threads with different users

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [August 23, 2020, 2:43pm UTC](https://meta.discourse.org/t/seeding-a-new-forum-by-creating-users-and-content/49345/18 "2020-08-23T14:43:13Z")

</div>

It’s reasonably easy to push them in with the API, especially if there are only a few hundred

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [June 8, 2024, 12:36pm UTC](https://meta.discourse.org/t/seeding-a-new-forum-by-creating-users-and-content/49345/19 "2024-06-08T12:36:55Z")

</div>

This topic was automatically closed after 2840 days. New replies are no longer allowed.
