# ERROR: duplicate key value violates unique constraint "import\_ids\_pkey"

**URL:** https://meta.discourse.org/t/error-duplicate-key-value-violates-unique-constraint-import-ids-pkey/142346
**Category:** Migration
**Created:** [February 22, 2020, 1:07pm UTC](https://meta.discourse.org/t/error-duplicate-key-value-violates-unique-constraint-import-ids-pkey/142346 "2020-02-22T13:07:37Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![plouf](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@plouf](https://meta.discourse.org/u/plouf)
#### Post date: [February 22, 2020, 1:07pm UTC](https://meta.discourse.org/t/error-duplicate-key-value-violates-unique-constraint-import-ids-pkey/142346/1 "2020-02-22T13:07:37Z")

</div>

Hello,

i’m trying to import my IPB 3.4 forum (200k users, 1.5M posts) into Discourse using [ipboard.rb](https://github.com/discourse/discourse/blob/master/script/import_scripts/ipboard.rb)  
Importing users went fine, but i encounter below error when importing topics:

```
**Traceback** (most recent call last):
10: from script/import_scripts/ipboard.rb:1029:in `<main>'
9: from /var/www/discourse/script/import_scripts/base.rb:47:in `perform'
8: from script/import_scripts/ipboard.rb:146:in `execute'
7: from script/import_scripts/ipboard.rb:355:in `import_topics'
6: from /var/www/discourse/script/import_scripts/base.rb:881:in `batches'
5: from /var/www/discourse/script/import_scripts/base.rb:881:in `loop'
4: from /var/www/discourse/script/import_scripts/base.rb:882:in `block in batches'
3: from script/import_scripts/ipboard.rb:377:in `block in import_topics'
2: from /var/www/discourse/script/import_scripts/base.rb:223:in `all_records_exist?'
1: from /usr/local/lib/ruby/gems/2.6.0/gems/rack-mini-profiler-1.1.6/lib/patches/db/pg.rb:56:in `exec'
/usr/local/lib/ruby/gems/2.6.0/gems/rack-mini-profiler-1.1.6/lib/patches/db/pg.rb:56:in `exec': **ERROR: duplicate key value violates unique constraint "import_ids_pkey" (**  **PG::UniqueViolation** **)**
**DETAIL: Key (val)=(discussion#50554) already exists.**

```

The error message is clear, but my question is how can i identify what is the duplicate key ? Where to look ?  
At first, i thought it was IPB topic\_id = 50554, so I deleted the record and relaunch the import script but I got the same error.  
I’m not sure where to look from here…

Thank you
