In a migration discussion titled “[ipboard.rb] ERROR: duplicate key value violates unique constraint ‘import_ids_pkey’”, t-e-d-d-y reported encountering a PostgreSQL unique constraint error while importing topics from IPB 3.4 using the ipboard.rb script, specifically for topic ID 2264 and several others. After deleting the problematic topics from the database, the import succeeded but resulted in data loss. pfaffman speculated that the script might be using incorrect IDs or misinterpreting the source data, and questioned whether the topics were deleted mid-import. t-e-d-d-y confirmed the issue persisted across fresh database installs and multiple environments, with no underlying IPB database corruption. pfaffman suggested manually inspecting the topic-fetching query to check for duplicate results. t-e-d-d-y asked if the fix should be applied directly in the ipboard.rb script, to which pfaffman advised running the query manually to debug. Ultimately, t-e-d-d-y resolved the issue by discovering that several posts linked to the problematic topics had the new_topic = 1 flag set incorrectly — manually resetting these fields allowed the import to complete successfully. The root cause remains unexplained, but the workaround restored full data integrity.
I deleted the 2264 topic from sql database and launch the script again, now its ok… but i lost the topic and 5 or 6 other important topics with the same error. What’s wrong ? How can i import these topics ?
I got this issue only with 9 topics, every else is ok, and i allways start from fresh install database, checked with differents sql backups and differents hosts. No error found in ipboard (index, database etc.).
I dont understand.
Souds like something non-obvious. My best guess is something like. . . well. I don’t have a best guess.
Maybe the query is somehow returning those topics twice somehow? You might try adding a .where ID=123 to the query that’s getting the topics to see if it’s somehow getting it twice and then figure out why.
Ok, I found !
Thank you for directing me to the solution. Look, I don’t know why but several posts related to problematic topics had the field new_topic = 1.