26

Re: phpBB 3 to punbb convertor ?

could it be where i have ran the converter multiple times? should i try from a fresh install again? ATM i can see member count, post count, tpoic count, but it doesnt show any forums or catagories

Re: phpBB 3 to punbb convertor ?

Assuming you're running the converter from the start, that shouldn't be an issue. However, try running it from a clean install.

28

Re: phpBB 3 to punbb convertor ?

I'll try it, and I am using the second forums.php file you posted. I see where the OP got punbb installed on his site, so I have hope that this will work smile

29

Re: phpBB 3 to punbb convertor ?

hmm, looking at my new punbb DB all of the tables are populated with the old phpbb3 information, it just isnt showing.

Re: phpBB 3 to punbb convertor ?

Could you paste some of that here?

31

Re: phpBB 3 to punbb convertor ?

some of what? I could export the forums/catagory/posts tables and post that here if you like. and BTW i was able to get this far by not using the updated forums.php file from the converter.

Re: phpBB 3 to punbb convertor ?

Did you use this code for forums.php? If not, you should.

<?php

    // Fetch forum info
    $result = $fdb->query('SELECT * FROM '.$_SESSION['php'].$_SESSION['phpnuke'].'forums WHERE forum_id>'.$start.' AND forum_type != 0 ORDER BY forum_id LIMIT '.$_SESSION['limit']) or myerror('phpBB: Unable to get table: forums', __FILE__, __LINE__, $fdb->error());
    $last_id = -1;
    while($ob = $fdb->fetch_assoc($result))
    {
        $last_id = $ob['forum_id'];
        echo $ob['forum_name'].' ('.$ob['forum_id'].")<br>\n"; flush();

        // Check for anonymous poster id problem
        $ob['forum_last_post_id'] == -1 ? $ob['forum_last_post_id'] = 1 : null;

        // Fetch user info
        $userres = $fdb->query('SELECT users.username, posts.post_time FROM '.$_SESSION['php'].'users AS users, '.$_SESSION['php'].$_SESSION['phpnuke'].'posts AS posts WHERE users.user_id=posts.poster_id AND posts.post_id='.$ob['forum_last_post_id']) or myerror("Unable to fetch user info for forum conversion.", __FILE__, __LINE__, $fdb->error());
        $userinfo = $fdb->fetch_assoc($userres);

        // Change last_post = 0 to null to prevent the time-bug.
        $userinfo['post_time'] == 0 ? $userinfo['post_time'] = 'null' : null;
        $ob['forum_last_post_id'] == 0 ? $ob['forum_last_post_id'] = 'null' : null;

        // Unset variables
        if(!isset($userinfo['username']))
            $userinfo['username'] = 'null';

        // Dataarray
        $todb = array(
            'id'                =>        $ob['forum_id'],
            'forum_name'    =>        $ob['forum_name'],
            'forum_desc'    =>        $ob['forum_desc'],
            'num_topics'    =>        $ob['forum_topics'],
            'num_posts'        =>        $ob['forum_posts'],
            'disp_position'=>        $ob['forum_order'],
            'last_poster'    =>        $userinfo['username'],
            'last_post_id'    =>        $ob['forum_last_post_id'],
            'last_post'        =>        $userinfo['post_time'],
            'cat_id'            =>        $ob['parent_id'],
        );

        // Save data
        insertdata('forums', $todb, __FILE__, __LINE__);
    }

    convredirect('forum_id', $_SESSION['phpnuke'].'forums', $last_id);

?>

33

Re: phpBB 3 to punbb convertor ?

using the above code gave the the original DB error I posted about. With the way it is now I repopulated my search index, did a search and was able to view the results, even the posts. in the admin CP i cant see the forums though

Re: phpBB 3 to punbb convertor ?

The problem I assume is the forums being set to invalid categories, which that code I gave you should address. Let me take another look at the code.

Re: phpBB 3 to punbb convertor ?

It doesn't even make sense, the differences between the default forums.php and the one I gave you are
1. My forums.php EXCLUDES forums that were treated as categories
2. My forums.php populates cat_id correctly
Neither change should cause a primary key error. If anything, the first change should make one less likely.

Could you email me an unconverted database dump, smartys at this domain, to test?

36

Re: phpBB 3 to punbb convertor ?

you want my old phpbb3 DB correct?

Re: phpBB 3 to punbb convertor ?

Right

38

Re: phpBB 3 to punbb convertor ?

sent to smartys@punbb.org

Re: phpBB 3 to punbb convertor ?

received. I'm not going to be able to do anything with it for a few hours though. wink

40

Re: phpBB 3 to punbb convertor ?

np at all, thanks for your help!

Re: phpBB 3 to punbb convertor ?

Oh dear, you found a bug in the converter. And you have no idea how looking through all that code made me want to rewrite the entire thing (there will be a rewrite for 1.3). wink
The easiest fix for you is to open the converter's functions.php, find

                // Have no id
                if($last == ''){
                        echo '<script type="text/javascript">window.location="index.php?page='.++$_GET['page'].'"</script>';
                        return;
                }

and replace it with

                // Have no id
                if($last == -1){
                        echo '<script type="text/javascript">window.location="index.php?page='.++$_GET['page'].'"</script>';
                        return;
                }

I don't even know why the code was set to '', the code seemed to mostly use -1

42

Re: phpBB 3 to punbb convertor ?

that worked like a charm, thank you so much!

43

Re: phpBB 3 to punbb convertor ?

Hi, I have tried this converter, with the modifications mentioned above.

All users, forums, categories etc have imported successfully. I can even see the list of topics within the forum. However, opening a topic does not display the post (punbb_posts table is empty).

Any help much appreciated smile

44

Re: phpBB 3 to punbb convertor ?

Apologies, it seems the source phpbb_posts table was empty also! There was an error migrating from MSSQL to MySQL which left this table blank.

Re: phpBB 3 to punbb convertor ?

I have tried these convertor fixed on 1.3 files and it did everything exept bring in the posts themselves. Is there any fixes for version 1.3 or should I do this convertion with the old pun

Re: phpBB 3 to punbb convertor ?

The converter was written for 1.2. You should be using 1.2.

47 (edited by editor14 2008-04-09 12:17)

Re: phpBB 3 to punbb convertor ?

Thanks Smartys,

I can get everything in except I get this error when converting the categories

File: /home/XXXXX/public_html/punBB/converters/PhpBB/categories.php
Line: 15

Converter reported: Unable to save to database.

Query: INSERT INTO `XXXXX`.newpun_categories (id,cat_name,disp_position) VALUES('18','test discussion','1')

Database reported: Duplicate entry '18' for key 1 (Errno: 1062)

Also,

All the attachments and links have not transfered

This is how they display:

[url=http://www.google.com/:3dxbgktg]Google[/url:3dxbgktg]

[attachment=1:3dxbgktg]<!-- ia1 -->X01.jpg<!-- ia1 -->[/attachment:3dxbgktg]
[attachment=0:3dxbgktg]<!-- ia0 -->X02.jpg<!-- ia0 -->[/attachment:3dxbgktg]

Cheers

Re: phpBB 3 to punbb convertor ?

Duplicate key: probably an issue like the one discussed earlier. The fix is here as well:
http://punbb.org/forums/viewtopic.php?p … 39#p104339
If you already applied that fix, try changing the code to this instead

                // Have no id
                if(empty($last) || $last == -1){
                        echo '<script type="text/javascript">window.location="index.php?page='.++$_GET['page'].'"</script>';
                        return;
                }

Re: phpBB 3 to punbb convertor ?

Thanks Smartys,

I've followed your instructions for this migration (from phpbb3 to punbb). I've modified the files of the conversion tool. And everything seems to have worked well... but not really.

There's a problem with bbcodes.

For example:

or:

[b:94qy912b]Musique[/b:94qy912b]



Many thanks in advance for your help.

Best regards, Dem.

Re: phpBB 3 to punbb convertor ?

Quick question: since this was a progressing thread, what are the final instructions we should follow?  Also, did anyone get to fix the BBCode error, or has anyone else actually had that problem?