# Merging two Discourse forums

**URL:** https://meta.discourse.org/t/merging-two-discourse-forums/72578
**Category:** Migration
**Created:** [October 23, 2017, 12:23am UTC](https://meta.discourse.org/t/merging-two-discourse-forums/72578 "2017-10-23T00:23:27Z")
**Posts on this page:** 1
**Showing post:** 12

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [October 23, 2017, 6:19pm UTC](https://meta.discourse.org/t/merging-two-discourse-forums/72578/12 "2017-10-23T18:19:37Z")

</div>

> [@pfaffman](#):
>
> This should be pretty easy to fix in the importer (e.g., add “X” before all of the import IDs).

I fixed a bug where this wouldn’t work because it was being converted to an integer. `"x123".to_i == 0`. I also added a way to treat the output files from the topic exporter as coming from different places, which essentially does the same trick of appending an arbitrary string to the id.

```plaintext
IMPORT_SOURCE=A bundle exec ruby script/discourse import_topics filename-1.json
IMPORT_SOURCE=B bundle exec ruby script/discourse import_topics filename-2.json

```

---

_[View the full topic](https://meta.discourse.org/t/merging-two-discourse-forums/72578)._
