1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

vBulletin 4 Subscription Importer

Discussion in 'Add-on Releases [Archive]' started by Slavik, Aug 24, 2011.

  1. Slavik

    Slavik XenForo Moderator Staff Member

    note - there is a bug with this importer that is addressed with this script. That will fix the upgrade records after running this importer. -Jake

    vBulletin 4 Subscription Importer

    Here we have it, once again courtesy of www.p8ntballer-forums.com and with the help of Robbo I am happy to provide you with the vBulletin 4 subscription importer.

    - - - -

    Screenshots

    subs1.png subs2.png subs3.png subs4.png
    - - - -

    Currently Implemented Features
    [​IMG] Import subscription types from vBulletin 4
    [​IMG] Import user subscriptions from vBulletin 4
    [​IMG] Selection of subscription currency type (if multiple are used)
    [​IMG] Import expired subscriptions from vBulletin 4

    - - - - -

    Important Note
    This addon is provided as is with no support or warrenties included. Help may be provided at the discression of myself or Robbo, but is not guaranteed. The importer currently works on my test environment and on our live test site, and is therefore considered "working". Premium support for 1 xenforo installation can be purchased by contacting Robbo and will be charged at a rate determined by him.

    Installation and Requirements
    Requires: Paul M's vBulletin importer here

    Before performing a data import please create appropriate backups of both the source database and your current xenForo database. The usage of this addon requires some basic edits to be made.

    1) Install Paul M's converter as per the instructions in his thread.
    2) Install the subscription importer by extracting the vBulletin4Plus.php file and uploading it to your /library/XenForo/Importer folder
    3) Open up your config.php file found in the /library folder of your xenForo installation
    4) At the bottom of the file copy the following code underneith the other config options.

    Code:
    $config['debug'] = '1';
    5) Save and upload the file.
    6) Log into your xenforo admin and select the "Development" tab at the top
    7) Select admin templates then Create new admin template
    8) The title of the admin template is

    Code:
    import_vbull4plus_subscriptions
    and the content

    PHP:
    <xen:title>Configure User Upgrade Prices:</xen:title>

    <
    div class="optionGroupDescription muted" style="margin: 10px 0;">

        <
    i>XenForo only allows one currency to be used per user upgradePlease select the ones you would like to use from the list below.</i>

    </
    div>

    <
    xen:form action="{xen:adminlink import/start-step}">

        <
    xen:foreach loop="$subsvalue="$subkey="$key">

            <
    xen:radiounit label="{$sub.title}:" name="options[currency-{$sub.subscriptionid}]">

                <
    xen:foreach loop="$sub.cost.0.cost" value="$amountkey="$currency">

                    <
    xen:option value="{$currency}">{$amount} {$currency}</xen:option>

                </
    xen:foreach>

            </
    xen:radiounit>

            <
    input type="hidden" name="options[currencies][]" value="{$sub.subscriptionid}/>

        </
    xen:foreach>

        <
    xen:submitunit save="Import remaining subscriptions" />

        <
    input type="hidden" name="options[_dummy]" value="1" /> <!-- ensures there are always options -->

        <
    input type="hidden" name="step" value="subscriptions" />

        <
    input type="hidden" name="options[total]" value="{$total}/>

    </
    xen:form>

    9) Save the template
    10) Select tools, and import external data
    11) Select the "vbulletin 4 with subscriptions" option in the drop down box and follow the on screen prompts

    - - - -

    Donate
    Please click the button below to donate for the upkeep and development of not only this addon but other new popular addons. All donations will be re-invested into creating new addons which will be released community.

    [​IMG]
    - - - -

    Thanks
    Robbo
    Kier + Mike
    Ashley
    Brogan

    - - - -

    Release History
    24/08/12 - Initial Release

    - - - -

    Known bugs
    -None

    - - - -

    Help, im missing a few user subscriptions!

    Due to the importer merging users witht he same email address or user name, subscription numbers may drop by a small amount from vBulletin. All subscriptions are imported, but if users are merged then the subscription is also merged.

    - - - -
     

    Attached Files:

    Puntocom, bousaid, Russ and 5 others like this.
  2. ankurs

    ankurs Well-Known Member

    can you do the same for vb 3.7 ?
     
  3. Robbo

    Robbo Well-Known Member

    If it uses the same database structure then just change the file to extend the 3.x importer and change the name. In theory it would work.
     
  4. ankurs

    ankurs Well-Known Member

    sounds good

    can you make this similar to thanks import addon ; which doesn't require any template edits
     
  5. Robbo

    Robbo Well-Known Member

    I'm not going to spend any more time on it for now. If I was going to do it properly I would be making it an addon which installs the templates and extends Paul's importer so subscriptions show up at the bottom of it.

    Then there is the fact I want to create my own vBull importer from scratch but the whole time thing and wheels being reinvented...
     
  6. RastaLulz

    RastaLulz Well-Known Member

    Very nice release!
     
  7. Mutt

    Mutt Well-Known Member

    yeah, I saw this post by Slavik about it but has anyone successfully done it? I haven't seen anyone say it worked out for them & I assume if it had someone would have chimed in w/ a here's how I did it / thanks post.

    also, now that Paul M's importer doesn't work w/ xen 1.1 does this importer run into the same issue?

    basically, can I hack this & get it to work w/ the Mike's xen 1.1 importer & move my vb3.8 subs over to xen 1.1?

    thanks for any help in advance
     
  8. Mutt

    Mutt Well-Known Member

    also, is the new line?
    PHP:
    class XenForo_Importer_vBulletin4Plus extends XenForo_Importer_Abstract
     
  9. Slavik

    Slavik XenForo Moderator Staff Member

    That will probably throw some error, I dont have the time to look at it at the moment. Your best bet if its important to you is to throw some money at Robbo ;)
     
  10. shawn

    shawn Well-Known Member

    Have you tested that yet? I'm working out the details for importing now... trying to figure out if I need to migrate to XF 1.0 first, import the old DB, then upgrade XF ... or what.
     
  11. shawn

    shawn Well-Known Member

    Continued from this thread...

    I'm getting the following error using Slavik's script:


    So far, I've tried to go from vB4 to xF 1.03 (using the instructions described above), I've tried to go from vB4 to xF 1.1 (using the current vB4 importer), and I've tried to go from vB3.8 to xF 1.1 (using the above plugin and the default xF importer). Same error every time.

    Does anyone know what is causing the error? Slavik's importer obviously worked for someone at some point. I'm not sure why it's not working for me now, though.
     
  12. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    That line is:

    Code:
    			$data = array(
    				'title' => $sub['title'],
    				'display_order' => $sub['displayorder'],
    				'recurring' => $recurring,
    				'cost_amount' => $cost[1],
    				'cost_currency' => $cost[0],
    				'length_amount' => $lengthAmount,
    				'length_unit' => $lengthUnit,
    				'extra_group_ids' => $usergroupIdMap[$sub['nusergroupid']],
    				'can_purchase' => $sub['active']
    			);
    
    The source subscription record has a "nusergroupid" of -1 and the importer doesn't recognize that as a valid usergroupid.

    I see two problems with the importer:

    1) -1 is a valid "nusergroupid" in vBulletin (it means no primary group specified). The importer should account for that. That is the nature of the error message.

    2) The importer is not preserving the "membergroupids" from the source subscription. It should do both "nusergroupid" and "membergroupids". vB subscriptions support both primary and secondary group changes while XF supports only secondary. The importer should probably just combine the two.
     
  13. Slavik

    Slavik XenForo Moderator Staff Member

    There should be no reason why it doesn't work with vb4 to XF 1.03 if using Paul M's converter. That is working perfectly fine and we transfered the P8ntballer Forums over using this system only a couple of weeks back.

    If you want to provide me a copy of your vb4 database I can see if I can get the import to work successfully here...
     
  14. shawn

    shawn Well-Known Member

    Winner, winner, chicken dinner. That's exactly what I've got -- the subscriptions leave the primary usergroup alone and add secondary usergroups.

    So I guess the next question is what needs to change in the script so that it checks membergroupids and nusergroupid and incorporates both when it does the import? I agree with Jake's point that it "should" work that way in order to be compatible with different installations.

    FWIW, I did try swapping membergroupids into line 105, but no dice. I probably screwed up the syntax or something, but I figured it was worth a shot for a quick fix.

    Slavik, I'm working from a 3.8x database, but tried the 4.0 importer just to exhaust all possibilities. As far as I can remember, the user data stuff is pretty much the same in 3.8 and 4.0, so the importer worked well enough (w/o errors) up to the point where it was ready to import subscriptions.

    I can get you a copy of my db, but it's fairly large. I'm thinking ~500mb gz.
     
  15. Slavik

    Slavik XenForo Moderator Staff Member

    Would you have any qwims with upgrading from 3.8 > 4.x > 1.03 > 1.1.1?
     
  16. shawn

    shawn Well-Known Member

    I might give it a shot just for testing purposes. But for the actual site migration, I'd rather have it be as quick and efficient as possible. The less downtime, the fewer steps to potentially go wrong, the better.
     
  17. shawn

    shawn Well-Known Member

    So... can someone fix this? Slavik? I can throw $40 into the pot if that helps.
     
  18. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I'm sure I can. I just don't want to interfere with some one else's addon.
     
    Slavik likes this.
  19. shawn

    shawn Well-Known Member

    Who wrote it the first time? Robbo, I guess?

    I understand the desire to not step on anybody else's toes. But the way it's coded right now, it only works for people who changed the primary usergroup. I'm kind of in the same boat -- I could probably figure out what to change to make it work, but don't have the time to work it out. Hence the bounty. And if we end up with an addon that anybody can use... that's plug and play.... all the better.
     
  20. shawn

    shawn Well-Known Member

    Okay, so I kinda got this thing working. I did a find/replace and switched 'nusergroupid' to 'membergroupids'. So far, that seems to work. One of my subscriptions was defined as 365 days. That seemed to have a problem with the 'length_amount' column in the xf_user_upgrade table (string too long). I switched this to one year and that fixed it. I also had several options for subscriptions in vB... one year, two years, etc. The importer didn't understand this and created that many of the same subscription, then added subscribers to each of them. So I deleted the extra year options in vb. So far, so good.

    The problem I have now is that the browser times out before the importer is complete. What do I have to add to the importer to prevent that from happening?
     

Share This Page