XF 1.2 phpbb import problem

niros_1234

Member
hi,

I've just made a phpbb import and i can't find some topics...

It seems that the global and the announcements topics from phpbb have NOT been imported...

Anyone else had this problem?
 
Are you sure they haven't imported? As there are only stickies in Xenforo and not announcements, all announcements and global announcements should have been converted to stickies (I think?) If not they may be just normal threads. It may be the latter actually, I seem to recall having to do something with announcements after conversion.
 
they are global so in each forum :)
the first topics

for example "Amanare cursuri adulti si copii" is a topic that is global and i can't find it in the new forum
Yes it is global and shows in every forum. However when you created it you did so in one forum and made it global from there. I suspect that you'll find it there.

Standard announcements are definitely there - "Vocea Cursantului" sau "Condica de Sugestii/Reclamatii" is in the same forum on your new site here. It is just a normal thread, not a sticky so I was right, announcements just become normal threads and will therefore appear in date order with other threads.
 
i have opened every forum and looked.
I can't find them.

When they were created... they were not associated with any forum... as they were created directly as global posts...
I think the boys that did the importer didn't take that into account.

The lucky thing is that there are only two global announcements

"Amanare cursuri adulti si copii" and
"Hot News on the Forum" sau "You Must Read THIS" :)

so... I could create them manual in the new forum, but they will lose the date and the views...
I think i will do a fresh reinstall of the xenforo... and before importing i will make them normal posts...

What do you think?
 
Are you really bothered about the date and views of these announcements? If so then you could make another fresh install after making them normal posts.

Alternatively to keep the dates (not views) you could create the 2 global posts again and install ******* - Change Threads/Posts Owner. You can then use this to change the date of the announcements to match the dates on the old forums.
 
I have the same problem at the moment on XF 1.4. This is a big issue, as the thread are simply not imported : it's only a matter of views, the original thread and all its replies are lost.
 
@niros_1234 Run this in phpMyAdmin to change the view counter for a thread
Code:
UPDATE xf_thread
SET xf_thread.view_count = {new_view_count}
WHERE xf_thread.thread_id = {thread_id}
Replace {new_view_count} with the view count you want and {thread_id} with the thread id.

So if you wanted to update a thread view count to 90,000 for a thread id 102, your query would be this one
Code:
UPDATE xf_thread
SET xf_thread.view_count = 90000
WHERE xf_thread.thread_id = 102
 
For those who want to include the global announcements try this fix, I haven't tried it in actual import but it should work.
Open file library\XenForo\Importer\PhpBb3.php
Find:
PHP:
// pull threads from things we actually imported as forums
        $threads = $sDb->fetchAll($sDb->limit(
            '
                SELECT topics.*,
                    IF(users.username IS NOT NULL, users.username, topics.topic_first_poster_name) AS username
                FROM ' . $prefix . 'topics AS topics FORCE INDEX (PRIMARY)
                LEFT JOIN ' . $prefix . 'users AS users ON (topics.topic_poster = users.user_id)
                INNER JOIN ' . $prefix . 'forums AS forums ON
                    (topics.forum_id = forums.forum_id)
                WHERE topics.topic_id >= ' . $sDb->quote($start) . '
                    AND topics.topic_status <> 2 # redirect
                ORDER BY topics.topic_id
            ', $options['limit']
        ));

Replace with
PHP:
        // pull threads from things we actually imported as forums
        $threads = $sDb->fetchAll($sDb->limit(
            '
                SELECT topics.*,
                    IF(users.username IS NOT NULL, users.username, topics.topic_first_poster_name) AS username
                FROM ' . $prefix . 'topics AS topics FORCE INDEX (PRIMARY)
                LEFT JOIN ' . $prefix . 'users AS users ON (topics.topic_poster = users.user_id)
                INNER JOIN ' . $prefix . 'forums AS forums ON
                    (topics.forum_id = forums.forum_id)
                WHERE topics.topic_id >= ' . $sDb->quote($start) . '
                    AND topics.topic_status <> 2 # redirect
                ORDER BY topics.topic_id
            ', $options['limit']
        ));
     
        // Fix: Include global announcements while importing
        // Url: https://xenforo.com/community/threads/phpbb-import-problem.58093/
        $announcements_forum_id = 3;
     
        $g_threads = $sDb->fetchAll($sDb->limit(
            '
                SELECT topics.*,
                    IF(users.username IS NOT NULL, users.username, topics.topic_first_poster_name) AS username,
                    ' . $sDb->quote($announcements_forum_id) . ' AS forum_id
                FROM ' . $prefix . 'topics AS topics FORCE INDEX (PRIMARY)
                LEFT JOIN ' . $prefix . 'users AS users ON (topics.topic_poster = users.user_id)
                WHERE topics.topic_id >= ' . $sDb->quote($start) . '
                    AND topics.topic_status <> 2 # redirect
                    AND topics.forum_id = 0
                ORDER BY topics.topic_id
            ', $options['limit']
        ));
     
        $threads = array_merge($threads, $g_threads);
        // Url: https://xenforo.com/community/threads/phpbb-import-problem.58093/
        // Fix: Include global announcements while importing
Someone who is has better knowledge than me could probably do magic and make them one query.

Be sure to change the value 3 to your forum id where you usually post announcements.
PHP:
$announcements_forum_id = 3;
So if your usual announcements forum id id 18 then replace
PHP:
$announcements_forum_id = 3;
with
PHP:
$announcements_forum_id = 18;
 
For those who want to include the global announcements try this fix, I haven't tried it in actual import but it should work.
Open file library\XenForo\Importer\PhpBb3.php
Find:
PHP:
// pull threads from things we actually imported as forums
        $threads = $sDb->fetchAll($sDb->limit(
            '
                SELECT topics.*,
                    IF(users.username IS NOT NULL, users.username, topics.topic_first_poster_name) AS username
                FROM ' . $prefix . 'topics AS topics FORCE INDEX (PRIMARY)
                LEFT JOIN ' . $prefix . 'users AS users ON (topics.topic_poster = users.user_id)
                INNER JOIN ' . $prefix . 'forums AS forums ON
                    (topics.forum_id = forums.forum_id)
                WHERE topics.topic_id >= ' . $sDb->quote($start) . '
                    AND topics.topic_status <> 2 # redirect
                ORDER BY topics.topic_id
            ', $options['limit']
        ));

Replace with
PHP:
        // pull threads from things we actually imported as forums
        $threads = $sDb->fetchAll($sDb->limit(
            '
                SELECT topics.*,
                    IF(users.username IS NOT NULL, users.username, topics.topic_first_poster_name) AS username
                FROM ' . $prefix . 'topics AS topics FORCE INDEX (PRIMARY)
                LEFT JOIN ' . $prefix . 'users AS users ON (topics.topic_poster = users.user_id)
                INNER JOIN ' . $prefix . 'forums AS forums ON
                    (topics.forum_id = forums.forum_id)
                WHERE topics.topic_id >= ' . $sDb->quote($start) . '
                    AND topics.topic_status <> 2 # redirect
                ORDER BY topics.topic_id
            ', $options['limit']
        ));
    
        // Fix: Include global announcements while importing
        // Url: https://xenforo.com/community/threads/phpbb-import-problem.58093/
        $announcements_forum_id = 3;
    
        $g_threads = $sDb->fetchAll($sDb->limit(
            '
                SELECT topics.*,
                    IF(users.username IS NOT NULL, users.username, topics.topic_first_poster_name) AS username,
                    ' . $sDb->quote($announcements_forum_id) . ' AS forum_id
                FROM ' . $prefix . 'topics AS topics FORCE INDEX (PRIMARY)
                LEFT JOIN ' . $prefix . 'users AS users ON (topics.topic_poster = users.user_id)
                WHERE topics.topic_id >= ' . $sDb->quote($start) . '
                    AND topics.topic_status <> 2 # redirect
                    AND topics.forum_id = 0
                ORDER BY topics.topic_id
            ', $options['limit']
        ));
    
        $threads = array_merge($threads, $g_threads);
        // Url: https://xenforo.com/community/threads/phpbb-import-problem.58093/
        // Fix: Include global announcements while importing
Someone who is has better knowledge than me could probably do magic and make them one query.

Be sure to change the value 3 to your forum id where you usually post announcements.
PHP:
$announcements_forum_id = 3;
So if your usual announcements forum id id 18 then replace
PHP:
$announcements_forum_id = 3;
with
PHP:
$announcements_forum_id = 18;


I think replacing

PHP:
// pull threads from things we actually imported as forums
        $threads = $sDb->fetchAll($sDb->limit(
            '
                SELECT topics.*,
                    IF(users.username IS NOT NULL, users.username, topics.topic_first_poster_name) AS username
                FROM ' . $prefix . 'topics AS topics FORCE INDEX (PRIMARY)
                LEFT JOIN ' . $prefix . 'users AS users ON (topics.topic_poster = users.user_id)
                INNER JOIN ' . $prefix . 'forums AS forums ON
                    (topics.forum_id = forums.forum_id)
                WHERE topics.topic_id >= ' . $sDb->quote($start) . '
                    AND topics.topic_status <> 2 # redirect
                ORDER BY topics.topic_id
            ', $options['limit']
        ));

with

PHP:
// pull threads from things we actually imported as forums

$announcements_forum_id = 0; // replace 0 with your announcement foum id.

        $threads = $sDb->fetchAll($sDb->limit(            '
                SELECT topics.*,
                    IF(users.username IS NOT NULL, users.username, topics.topic_first_poster_name) AS username,
                    IF(forums.forum_id IS NOT NULL, forums.forum_id, ' . $sDb->quote($announcements_forum_id) . ') AS forum_id
                FROM ' . $prefix . 'topics AS topics FORCE INDEX (PRIMARY)
                LEFT JOIN ' . $prefix . 'users AS users ON (topics.topic_poster = users.user_id)
                LEFT JOIN ' . $prefix . 'forums AS forums ON
                    (topics.forum_id = forums.forum_id)
                WHERE topics.topic_id >= ' . $sDb->quote($start) . '
                    AND topics.topic_status <> 2 # redirect
                ORDER BY topics.topic_id
            ', $options['limit']
        ));

In a more ideal situation, there'd be an option to set the announcement forum id when you're doing the import. I haven't tested this but I think something along these lines would work.
 
Back
Top Bottom