# Migrare contenuti specifici Xenforo

**URL:** <https://meta.discourse.org/t/migrate-specific-xenforo-content/291527>\
**Category:** Migration\
**Tags:** xenforo\
**Created:** [13 Gennaio 2024, 4:27pm UTC](https://meta.discourse.org/t/migrate-specific-xenforo-content/291527 "2024-01-13T16:27:48Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)\
**Post date:** [13 Gennaio 2024, 4:36pm UTC](https://meta.discourse.org/t/migrate-specific-xenforo-content/291527/2 "2024-01-13T16:36:45Z")

</div>

> [@Ventrilo](#):
>
> importa i thread e il primo post di ogni thread

modifica solo l’SQL nello script di importazione

```plaintext
        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

```

aggiungi `AND p.post_id = t.first_post_id` alla clausola `WHERE`

> [@Ventrilo](#):
>
> Voglio anche riassegnare l’autore del thread a un diverso forum/account utente di discourse che ho già creato

Cambia

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

in

`mapped[:user_id] = xxx`

dove `xxx` è l’ID utente di Discourse a cui vuoi assegnare gli argomenti.

---

_[View the full topic](https://meta.discourse.org/t/migrate-specific-xenforo-content/291527)._
