# /posted empty with a phpbb3 import

**URL:** <https://meta.discourse.org/t/posted-empty-with-a-phpbb3-import/256443>\
**Category:** Migration\
**Tags:** phpbb\
**Created:** [February 27, 2023, 10:34pm UTC](https://meta.discourse.org/t/posted-empty-with-a-phpbb3-import/256443 "2023-02-27T22:34:15Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![cocococosti](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cocococosti/32/231474_2.png) [@cocococosti](https://meta.discourse.org/u/cocococosti)\
**Post date:** [February 28, 2023, 6:03am UTC](https://meta.discourse.org/t/posted-empty-with-a-phpbb3-import/256443/5 "2023-02-28T06:03:57Z")

</div>

Thank you for reporting this Jay!

Seems like an issue with the `ensure_consistency` rake task. I just checked on a migration I’m working on now (haven’t run the ensure\_consistency task yet) and the TopicUser records were already created with posted: false (the default). When the rake task reaches [this point](https://github.com/discourse/discourse/blob/main/lib/tasks/import.rake#L60) it generates a “duplicate key” error and the records are not created because of the `ON CONFLICT DO NOTHING`

```plaintext
def insert_topic_users
  log "Inserting topic users..."

  DB.exec <<-SQL
    INSERT INTO topic_users (user_id, topic_id, posted, last_read_post_number, first_visited_at, last_visited_at, total_msecs_viewed)
         SELECT user_id, topic_id, 't' , MAX(post_number), MIN(created_at), MAX(created_at), COUNT(id) * #{MS_SPEND_CREATING_POST}
           FROM posts
          WHERE user_id > 0
       GROUP BY user_id, topic_id
    ON CONFLICT DO NOTHING
  SQL
end

```

The TopicUser records are created at the create\_topic step, more specifically here [discourse/lib/topic\_creator.rb at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/main/lib/topic_creator.rb#L69).

I opened a PR with a fix that you could run now:

[https://github.com/discourse/discourse/pull/20473](https://github.com/discourse/discourse/pull/20473)

---

_[View the full topic](https://meta.discourse.org/t/posted-empty-with-a-phpbb3-import/256443)._
