# 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:** 4

<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, 2:16pm UTC](https://meta.discourse.org/t/merging-two-discourse-forums/72578/4 "2017-10-23T14:16:56Z")

</div>

> [@omarfilip](#):
>
> No users in A and B have the same email address, but ~100 have the same user name.

I think I see why that’s happening. The [topic importer only looks at email address](https://github.com/discourse/discourse/blob/master/lib/import_export/topic_importer.rb#L21-L29), but it uses a common importer method to create a new user when it doesn’t find an existing user with the email address. That method will [look for a matching username](https://github.com/discourse/discourse/blob/master/script/import_scripts/base.rb#L272), which is not what I want… This is a bug so I’ll have a look.

Scratch that. It does work by looking only at email addresses. @omarfilip Was your Discourse A site a migration from other forum software?

---

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