Skip to:
Content
Pages
Categories
Search
Top
Bottom

Dev: Invision v4 converter, SQL -> field_map


  • BrianHenryIE
    Participant

    @bbrian

    I’ve been working on a converter to import our Invision v4 forum to bbPress. I’ve got the users, forums and topics all importing reasonably well.

    https://github.com/EnhancedAthlete/bbPress-Invision-v4-Converter

    I’m having trouble with the titles which are stored in a language table:

    core_sys_lang_words

    | word_id | ... | word_app | ... | word_key | word_default | word_custom | ...
    | 8379 | ... | forums | ... | forums_forum_2 | Generic Discussion | Generic Discussion | ...

    To retrieve a single forum title, I can use:
    SELECT word_default as forum_name FROM ipbforum.core_sys_lang_words WHERE word_key = CONCAT('forums_forum_', 2)

    or to retrieve them all, something like:

    
    SELECT word_default 
    FROM ipbforum.core_sys_lang_words 
    WHERE word_app = 'forums' 
    	AND word_key IN 
        (SELECT CONCAT(prefix, id)  FROM 
    		(SELECT 'forums_forum_' as prefix, ipbforum.forums_forums.id 
            FROM ipbforum.forums_forums) 
            AS t)
    

    Or all with the forum ids:

    
    SELECT ipbforum.core_sys_lang_words.word_default as forum_name, word_key_table.forum_id as forum_id 
    FROM ipbforum.core_sys_lang_words, 
    	(SELECT CONCAT(prefix, id) AS word_key, 
    					id AS forum_id 
    			FROM 
    				(SELECT 'forums_forum_' AS prefix, 
    								ipbforum.forums_forums.id 
    						FROM ipbforum.forums_forums) 
                            AS temp)
    	AS word_key_table
    WHERE ipbforum.core_sys_lang_words.word_key = word_key_table.word_key
    

    but I’m struggling to figure out how to write that in the BBP_Converter_Base extended class field_map[].

    I’ve looked at some other converters and don’t see anything similarly complicated so I’m assuming there’s a more straightforward way.

    Any pointers appreciated! Once this is figured, the converter should be good enough for most people’s use.

Viewing 8 replies - 1 through 8 (of 8 total)

  • rallinspired
    Participant

    @rallinspired

    @bbrian

    Hey, I am trying to use your plugin. Your write up is unclear to me, do I need to have the same the forum title on the new bbpress forum the invision forum? Is the Upload folder really needed and what is it?? I have done some conversion but nothing is showing up on the new forum I created and they have same titles as the old one on the Invision.

    Also if leave the Table Prefix blank to does nothing, I have to put in “orig_ibf” for it to work. Its converting stuff but i dont see where…. Do i have to wait for the converting to stop before I seen anything pop up on the new forums???

    Thank you.


    rallinspired
    Participant

    @rallinspired

    @bbrian

    Ok I did some looking after awhile, the topics and replies are there but are not link the forum titles I created. The plugin is still running, does the converted topics and replies not auto link to correct forum topics I create? The forum topics are the same names as the old Invision forum topics.

    Thank you.


    BrianHenryIE
    Participant

    @bbrian

    The forums should import ok, just without the proper title and description, and you’ll be able to see them at /wp-admin/edit.php?post_type=forum. When mine import, one parent forum with no posts contains our 13 actual forums.

    The upload folder is for copying across the images, emoticons, and attachments users have added to their posts on Invision 4 forum. If your Invision 4 forum is still live (which it probably is), the URL of your forum with /uploads added should work fine. If you set $ipb_uploads_url to null the forums themselves should import no problem, but without media.

    The table prefix is dependent on how your Invision database was set up initially. Typically, if it’s the only application using the database, there’s no need for a prefix, but if multiple applications (e.g. WordPress and Invision) share a database it’s prudent to set a prefix on the database table names so you can be confident both applications won’t try to use the same table name (e.g. “users”), and it’s essential if multiple instances of the same application share the same database (e.g. two independent WordPress installations).

    The forums->topics->replies associations all work correctly for me. Are you saying that your replies have imported but aren’t associated correctly with their topics? This isn’t something that needs the importer to complete to verify is working. Although, the topics might show how many replies are part of the topic before the replies themselves have been imported. My import takes a few hours to complete.

    Let me know how you get on. I’ve still to do more work on this myself before I finally migrate our forums so now is a good time for feedback and suggestions.


    rallinspired
    Participant

    @rallinspired

    @bbrian

    Thank you for the reply back, it seems to be working. My questions is I have stopped and start many times, does it start off from it left off or does it start over and make duplicates? Hours, that must be nice… Im like 3 days in… lol… the forum im helping to convert has been online since 2007 I think and just shut down the other day. Also, I do not have the Upload folder yet but when I get it do I have to start the process all over again or can just update the link in the php file and just click start? To give you and idea right now im at 691,806 replies and still going. The users and topics seemed to be converted just fine and the forum. Question, I do see the forums I made and then there are new ones from the conversation. It looks like the topics and replies are linked to the converted forums and not the one I made (which are the same name as the converted ones) should I just delete the ones I made? Also im working a VM if you need access to it please let know to make sure im doing this right lol.

    Thank you.


    BrianHenryIE
    Participant

    @bbrian

    When you stop and start it should continue from where it was before. This is part of the standard bbPress importer setup. Unless you choose: “Start Over: Restart the converter from the beginning (This forces all steps back to 0. Avoid duplicate data by purging or resetting first.)” on the Import Forums screen. As it suggests, under the Reset Forums tab you can delete all existing forums, topics and posts. Unfortunately, my plugin doesn’t delete the Redirection plugin settings or the images it imports (although it may be possible to hook into the forum reset code and achieve that).

    You will have to start the import again to import the images and attachments. The converter scans each post as it’s importing for local links and then retrieves the files from the uploads folder. Some are direct links, some are links via Invision’s ~attachment.php?id=123 which need to query the database to find the true file path, and some are older style Invision v3 attachments.

    As you see, the converter just creates its own forums and ignores what’s there, so just delete them.

    I don’t think there’s any need, unless something goes wrong, to give me any access. I suggest doing a feature comparison between Invision and bbPress and see what plugins you’re going to need to retain tools you were using in Invision. If they match what I know I need, I’ll work on converting the appropriate data for both of us.


    rallinspired
    Participant

    @rallinspired

    @bbrian

    First I want to thank you for all your help and clarification! I understand whats going how now, also i had ran this so many times that I had 4 copies of each reply, lol. So I did a forum reset and checked the database for anything left over (which there was) and deleted them and reran the whole thing. This time it went smooth, only thing is I could not get the Uploads folder which is fine I guess, all we needed the main topics and wright-ups. Will say this though, every time I run “Recalculate the position of each reply” it errors out I guess to a white page… I dunno.. lol

    Thank you.


    BrianHenryIE
    Participant

    @bbrian

    A comment in another thread says the white screen problem is from a time out, and when you run it again it continues where it left off 🙂

    The uploads that aren’t imported are going to be lots of broken links on your forum!


    rallinspired
    Participant

    @rallinspired

    @bbrian

    Ahh ok, ill just rerun until says complete. Also not having the uploads is fine as long as the Main topics in the forums are there. We are just trying to save it for informational purpose.

    Thank you.

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Skip to toolbar