# How can I migrate Stack Overflow data into Discourse?

**URL:** https://meta.discourse.org/t/how-can-i-migrate-stack-overflow-data-into-discourse/284989
**Category:** Migration
**Tags:** stackoverflow
**Created:** [November 9, 2023, 7:19pm UTC](https://meta.discourse.org/t/how-can-i-migrate-stack-overflow-data-into-discourse/284989 "2023-11-09T19:19:34Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Discoder](https://avatars.discourse-cdn.com/v4/letter/d/97f17d/32.png) [@Discoder](https://meta.discourse.org/u/Discoder)
#### Post date: [November 9, 2023, 7:19pm UTC](https://meta.discourse.org/t/how-can-i-migrate-stack-overflow-data-into-discourse/284989/1 "2023-11-09T19:19:34Z")

</div>

I want to transfer about 1000 posts from our old Stack Overflow Enterprise instance into Discourse. Has anyone migrated Stack Overflow data into Discourse?

Is there a plugin or repo with scripts that could help facilitate this?

---

<div class="post-metadata">

### Author: ![Ric\_harvey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ric_harvey/32/341841_2.png) [@Ric\_harvey](https://meta.discourse.org/u/Ric_harvey)
#### Post date: [November 9, 2023, 10:48pm UTC](https://meta.discourse.org/t/how-can-i-migrate-stack-overflow-data-into-discourse/284989/2 "2023-11-09T22:48:09Z")

</div>

Hey so I’m looking to do a similar thing so I’ll wait for a more informed answer but I did find this:

> <https://github.com/discourse/discourse/blob/main/script/import_scripts/stack_overflow.rb>

This seems to suggest there is a way, would be great to get some comment on how to use it.

---

<div class="post-metadata">

### Author: ![Discoder](https://avatars.discourse-cdn.com/v4/letter/d/97f17d/32.png) [@Discoder](https://meta.discourse.org/u/Discoder)
#### Post date: [November 16, 2023, 7:29pm UTC](https://meta.discourse.org/t/how-can-i-migrate-stack-overflow-data-into-discourse/284989/3 "2023-11-16T19:29:13Z")

</div>

Not sure how far along you got with the above, but what I ended up doing was just using the Stack Overflow and Discourse APIs. Pulled the posts/answers I wanted from the Stack Overflow API, did some data processing/formatting and then used the Discourse API to create new posts based off the data.

---

<div class="post-metadata">

### Author: ![Ric\_harvey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ric_harvey/32/341841_2.png) [@Ric\_harvey](https://meta.discourse.org/u/Ric_harvey)
#### Post date: [November 16, 2023, 10:00pm UTC](https://meta.discourse.org/t/how-can-i-migrate-stack-overflow-data-into-discourse/284989/4 "2023-11-16T22:00:34Z")

</div>

Any plans to share your code? That would be super handy to many people I’m sure.

---

<div class="post-metadata">

### Author: ![Discoder](https://avatars.discourse-cdn.com/v4/letter/d/97f17d/32.png) [@Discoder](https://meta.discourse.org/u/Discoder)
#### Post date: [November 17, 2023, 7:38pm UTC](https://meta.discourse.org/t/how-can-i-migrate-stack-overflow-data-into-discourse/284989/5 "2023-11-17T19:38:45Z")

</div>

Sure! As soon as I finish our migration, I’ll make sure to come back and post a python script that streamlines the Stack Overflow Post to Discourse Post migration. Should be here in a couple of weeks!

---

<div class="post-metadata">

### Author: ![jericson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jericson/32/116215_2.png) [@jericson](https://meta.discourse.org/u/jericson)
#### Post date: [November 19, 2023, 2:37am UTC](https://meta.discourse.org/t/how-can-i-migrate-stack-overflow-data-into-discourse/284989/6 "2023-11-19T02:37:09Z")

</div>

> [@Discoder](#):
>
> Pulled the posts/answers I wanted from the Stack Overflow API

I have a script I use to download posts from public Stack Overflow/Exchange to post on my Jekyll blog:

[https://github.com/jericson/se2jekyll.rb](https://github.com/jericson/se2jekyll.rb)

I considered using the Discourse API to post them to my forum, but I don’t have so many that copy-and-paste doesn’t work just as well. With a thousand or so posts, automating that steps is key! Good luck.
