迁移特定 Xenforo 内容

只需修改导入脚本中的 SQL

        SELECT p.post_id id,
               t.thread_id topic_id,
               #{@prefix_as_category ? "t.prefix_id" : "t.node_id"} category_id,
               t.title title,
               t.first_post_id first_post_id,
               t.view_count,
               p.user_id user_id,
               p.message raw,
               p.post_date created_at
        FROM #{TABLE_PREFIX}post p,
             #{TABLE_PREFIX}thread t
        WHERE p.thread_id = t.thread_id
        AND p.message_state = 'visible'
        AND t.discussion_state = 'visible'
        ORDER BY p.post_date
        LIMIT #{BATCH_SIZE}" # needs OFFSET

在 WHERE 子句中添加 AND p.post_id = t.first_post_id

更改

mapped[:user_id] = user_id_from_imported_user_id(m["user_id"]) || -1

至

mapped[:user_id] = xxx

其中 xxx 是您要分配主题的 Discourse 用户 ID。