# Merging 2 discourse forums

**URL:** <https://meta.discourse.org/t/merging-2-discourse-forums/35060>\
**Category:** Product Support\
**Created:** [29 oktober 2015 om 14:10 UTC](https://meta.discourse.org/t/merging-2-discourse-forums/35060 "2015-10-29T14:10:43Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![Walker\_Blackwell](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/walker_blackwell/32/119568_2.png) [@Walker\_Blackwell](https://meta.discourse.org/u/Walker_Blackwell)\
**Post date:** [13 september 2018 om 17:29 UTC](https://meta.discourse.org/t/merging-2-discourse-forums/35060/15 "2018-09-13T17:29:50Z")

</div>

Ok. So one (hopefully) more question.

I get this error right off the bat:

```
 .rvm/gems/ruby-2.5.1/gems/pg-1.1.0/lib/pg/connection.rb:173:in `get_last_result': ERROR: duplicate key value violates unique constraint "index_topic_users_on_topic_id_and_user_id" (PG::UniqueViolation)
    DETAIL: Key (topic_id, user_id)=(6233, 1213) already exists.
    CONTEXT: COPY topic_users, line 1437

```

Does this mean that if I have a topic\_id and user\_id combo that is identical on both databases this will not work?

If so, that will become a problem in some use-cases where there is one or two admins that are replying a LOT topics on both forums that want to be merged. Because the assumption on this action is that it’s uni-directional and there are ideally no duplicate posts between forums (only duplicate user emails) can this script update the post ID with a unique # if it hits this error?

best,  
Walker

---

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