1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.2 phpbb import problem

Discussion in 'Installation, Upgrade, and Import Support' started by niros_1234, Aug 21, 2013.

  1. niros_1234

    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?
     
  2. Martok

    Martok Well-Known Member

    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.
     
  3. niros_1234

    niros_1234 Member

    i've rebuild the search index and I have been searching them...
    i don't find them
     
  4. niros_1234

    niros_1234 Member

    the old forum:
    Code:
    http://letsdance.ro/forum/
    the new forum:
    Code:
    http://letsdance.ro/forums/
     
  5. Martok

    Martok Well-Known Member

    In which forum on the old site are the global announcements actually located in?
     
  6. niros_1234

    niros_1234 Member

    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
     
  7. Martok

    Martok Well-Known Member

    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.
     
  8. niros_1234

    niros_1234 Member

    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?
     
  9. Martok

    Martok Well-Known Member

    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.
     
  10. Aurèle

    Aurèle Member

    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.
     
  11. batpool52!

    batpool52! Well-Known Member

    @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
     
    Aurèle likes this.
  12. batpool52!

    batpool52! Well-Known Member

    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;
     
    Aurèle likes this.
  13. Daniel Hood

    Daniel Hood Well-Known Member


    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.
     
    batpool52! likes this.

Share This Page