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

XF 1.3 Importing warnings/infractions from vBulletin 4.x

Discussion in 'Installation, Upgrade, and Import Support' started by shello, Mar 31, 2014.

  1. shello

    shello Member


    We're testing the import of a vBulletin 4.x installation to XF1.3. I can see that the post and profile warnings (vB's infractions) are imported, but "predefined" warnings (vB's Infraction Levels) and warning actions (vB's Infraction Groups) are not imported.

    This poses a problem for us: Users with active warning points that amount to a certain warning action aren't imported with those actions applied, and therefore a user with some infraction level in vB doesn't have a warning action in the imported XF install.

    I know that I could define the actions before importing, but most of them depend on existing user groups (in order to restrict some features, or node permissions) which are imported from the vBulletin install.
    I could also define the warning actions after importing, but then I would need a way of rebuilding the warning actions for every user—this takes extra time (especially for a install with 200K+ users), but the extra work redefining warnings and actions is negligible (5 minutes at most)—but I can't find a way of doing this in the admin panel.

    Is there a way of rebuilding the warning actions applied to all users (so it can be ran after redefining the warnings and actions)?
    If not, how should I handle this case?

    Thanks in advance.
  2. Mike

    Mike XenForo Developer Staff Member

    It's a tricky situation. Warning actions are designed to be run as "point in time" sort of thing. If you get 10 points but there's no action for that when you get the points, nothing happens if the action is later added. The system looks at point changes to determine what to do, so there isn't a rebuild option and there isn't really any code that would totally fit that model. Because of that, the only real way to apply a particular warning action is to have the points total cross the threshold in question.

    What are the warning actions you're looking to apply (specifically) and how many people would that apply to?
    Jake Bunce likes this.
  3. shello

    shello Member

    For context, and to be clear, we do have a test import of our vB 4.x database running, where I am testing XF 1.3 for our scenario.

    The number of not-expired (i.e. active) warning points for some users, today, is greater than some of the warning actions we have set up; the users were imported before I set up warning actions (I assumed the XF's importer would import vB's infraction groups) and, just as you confirmed, these actions were not applied to the existing users because I only defined them after the import (i.e. the actions are not retroactive).
    We already have infraction groups defined in our vBulletin install: they apply restrictions to users with active infraction points that cross the infraction groups threshold.
    So while some users are currently in some infraction group in the vB forum, the XF install doesn't have the equivalent actions applied.

    We use two kind of warning actions: adding a user (temporarily or permanently) to one or more user groups; and banning the user (permanently).
    The former kind of action uses user groups to restrict these users from accessing some functionality (such as having/customizing their avatar or signature), or even restricting access to some nodes.

    Now I realized that I may have wrongly assumed (in the first post) that if I defined the warning actions before importing, when the infractions were imported the actions would be applied correctly—I'm unsure about this right now.
  4. Mike

    Mike XenForo Developer Staff Member

    We don't import actions. Actions that are stored in XF will not be applied to users when importing. Essentially, we import their points and the infractions that have been applied to them. Importing some of these specific nuances can be very difficult as often concepts don't map or there isn't a direct equivalent. I'm not sure how feasibly we can actually calculate the data that we'd need to store for the actions to be applied (due to varying approaches and data structures).

    Unfortunately, I don't see a great way around this with the existing code short of some manual intervention (which would unfortunately still get some of the trigger dates incorrect).
  5. SchmitzIT

    SchmitzIT Well-Known Member

    @Mike - Dealing with something similar at the moment, and figured I'd use an existing thread rather than opening a new one.

    If any infractions are imported, but no groups were defined for the infraction users to go into prior to the import, how would we best accomplish putting anyone with an active infraction into a specific group? Any ideas?

  6. Mike

    Mike XenForo Developer Staff Member

    If your warning actions are point threshold based, then you can programmatically take people down to 0 points, save, and then return them to the correct point value and it will recalculate the necessary warnings. This would lead to incorrect timings for temporary (time-based) warnings.
  7. SchmitzIT

    SchmitzIT Well-Known Member

    Thanks, @Mike.

    Would the import handle it if we'd switch the infraction system to group based now, and then simply wait for the period defined in the infraction to pass? (All infractions show as warnings in XF, lasting 1 month. If we add the group connection tomorrow, and wait 1 month, would it be fair to assume the importer would then work properly?

    Thanks :)

  8. Mike

    Mike XenForo Developer Staff Member

    The import just brings the points and history in. It never touches any actions, regardless of whether they exist. The only way to trigger actions is to change the points.

    There was a customer that used the data writers to change the points to 0, save, and then return the points to the correct value. This will reapply the actions, but this only works if your actions are all "while above the points threshold" (or permanent); time-based actions depend on when the point change actually happened so wouldn't be calculated correctly with this approach.
  9. SchmitzIT

    SchmitzIT Well-Known Member

    I'm sorry, but I'm still not sure I understand, @Mike.

    The vB forum adds a point, and keeps that point in the DB for 30 days. We simply now have them add that member to a group as well.

    After 30 days, doing an import, would that keep on functioning?
  10. Mike

    Mike XenForo Developer Staff Member

    The warnings themselves are imported and the current point totals are imported . However, the result of any warning actions (including temporary group membership) is not imported. I don't even recall if groups are applied for infractions in the "normal" way so it's possible the user wouldn't be part of the group from the import.

Share This Page