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

Polls not importing properly from vB to XF

Discussion in 'Installation, Upgrade, and Import Support' started by Rudy, Mar 23, 2011.

  1. Rudy

    Rudy Well-Known Member

    I am working on converting a forum from phpBB2 to XF, using vB as the intermediate step.

    Looking at the import after using ImpEx, the polls look correct in vB. When I import to XF, the poll results are lumped into the first choice in the poll, and the number of "votes" (which aren't really votes, of course) does not add up to the actual votes. For example, one recent poll has 22 total voters, with votes across all options, where the XF import shows 104 votes for the first poll item, with the rest being zero. I did not vote in the poll, and yet I see poll results when I visit the thread (meaning, I can't vote on it). Looking in the database tables, I can see where the first choice got all the votes, and a list of user IDs of who voted, so the results in the forum match what I'm seeing in the database tables.

    Have I missed a step in the import, or should we move this over to the bug report area? I can send a URL to the forums privately if needed.
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  3. Rudy

    Rudy Well-Known Member

    I'm using vB 3.8.7 as there isn't an official 4.0/4.1 importer yet (and I didn't want to take a chance). I have access to all of these versions as we still have a valid vB licenses.

    I'm not sure if there could have been something improperly flagged when moving from phpBB2 to vB, but since the polls appear OK in vB, I would think they made the move OK. phpBB2's polls were primitive compared to vB. And, all of our polls were available only to registered/logged-in members (no guest voting IOW).

    Other than the polls, and a few stray extended characters (such as ampersands showing as & in some thread titles), the import went rather smooth. In fact, one of my admins logged in to XF with his phpBB2 password. Color ME surprised! :D
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I am importing from vB 3.7

    I don't know what else to suggest about your polls. Just make sure they are OK in vB before moving to xenForo.

    phpBB2 uses a compatible password hashing scheme so ImpEx is able to preserve those passwords. And then xenForo preserves passwords coming from vB. So all user passwords should work when going the "phpBB2 -> vB -> xenForo" route.
  5. Rudy

    Rudy Well-Known Member

    They looked fine in vB. The counts matched what we had in our phpBB2 forum.
  6. Rudy

    Rudy Well-Known Member

    ImpEx has been giving me fits. I ended up finding an older version from 2009 on my hard drive, and installed that instead. Avatars still hang up the process, so I will not be importing those. When I get to the user module, the screen just goes blank, with no error message, and the only way to recover from this is to wipe out vB's tables and start over. (This is for either ImpEx version, and I had debugging turned on also.)

    The vB forum was no help, as usual...many calls for help importing from phpBB2 went unanswered or unhelpful. One user installed phpBB3 as an intermediate step from phpBB2 to vB. The docs also say avatars won't import; if that were true, there would not be code in the phpBB2 import module (which there is).

    I have a cleaner import from phpBB to vB now, so I'm going to give it a try. The cleaner.php script in /impex/tools would not work either, so any cleanup I did via a replace SQL operation (UPDATE vb_thread SET title = replace (title, '&', '&');). I had to do this for usernames and post titles, although I will be deleting post titles since XF does not have a line for them (it shows up boldface as the first line in the post). To cure these issues, I modified my copy of the phpBB2 impex files.

    I'll report tomorrow after I try the import from vB to XF. Hopefully the polls will import correctly this time!
  7. Rudy

    Rudy Well-Known Member

    No good!

    The polls are fine in vB, but the counts get all wacky in XF. The counts in vB match exactly what is in the original phpBB forum.

    This should probably move over to bug reports...something isn't getting transfered properly in my situation, and it's the last thing holding up launching our forum.
  8. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    How big is your vB database? If you want to trust me with a copy of your database then I can test the import myself. Or if I can at least get access to phpmyadmin to view your database then I can examine the poll data and maybe find an explanation for your problems. My polls import fine.
  9. Rudy

    Rudy Well-Known Member

    Jake--I use a freeware program called HeidiSQL to access the database remotely. Runs on Windows though, so if you don't have that, I don't know if it'll run in a virtual Windows session or not. It connects via standard MySQL ports, so I don't see why not. I use it constantly in my development work--very handy to see if database changes are being made, and great for testing out queries! (It used to be MySQL-Front many years ago; someone else took over development and kept it going.)

    We have phpMyAdmin buried on our server somewhere, but it's only accessible via our account control panel, and I've never used it. I could probably install a public version of it somewhere if needed.

    The SQL file is about 101MB, gzipped. It's up to you if you'd rather download it, or look at the database remotely. Let me know and I"ll send details privately.

    Nasr likes this.
  10. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    At 101MB I can just download it. The easiest way would be for you to put it online and give me the URL.
  11. Rudy

    Rudy Well-Known Member

    Jake figured out why it happened...now I'm trying to think of a way to correct it. To make a long story short, phpBB2 does not have as much poll data as vB, so ImpEx only imports what it can. (phpBB2 records who voted, but only to prevent that member from voting again. It does not tie a voter to an actual vote they made.) ImpEx imports enough to vB so it can display the proper number of votes, but leaves other poll tables partially unpopulated. XF, expecting that data to be there in an import, doesn't know how to process those empty tables, and just does what it can with what it finds.

    More later...
  12. Rudy

    Rudy Well-Known Member

    I managed to get it corrected. I had to write a small PHP script to empty and rebuild vB's pollvote table. In doing so, I also had to "fudge" the voter IDs so that the correct vote counts would show up: XF will not display proper results unless the votes are unique (IOW, each vote needs a valid user ID). I had tried creating one dummy user to apply votes to, but since the votes all showed the same user ID, XF would only show one vote per choice, which wasn't correct.

    Since I am keeping the polls private, it did not matter which user ID I applied to each choice. But what I did was go back to the phpBB2 table and pull out the IDs of users who voted, then applied one of them to each vote choice. So, while the correct users may not be on each vote, XF can still tell which members have voted in that particular poll, meaning I can keep the polls open for further voting.

    And, thank goodness vB keeps the import user and poll IDs! (y)

    My only other phpBB2 problem was some stray extended HTML characters like & and " showing up in usernames, thread and PM titles, poll titles and choices, etc. But, those can be cleaned up after the fact with a simple search/replace query right in MySQL.
  13. Rudy

    Rudy Well-Known Member

    Avatars do import, but ImpEx was choking on them each time. No clue as to why, either, until I tried another part of ImpEx and got an "out of memory" message. Well, when I went back to do another pass of importing, I lowered the number of users imported to a very low number (250, I think?), and the users imported with their avatars.

    I am starting to wonder why vB even keeps ImpEx up there if they are not going to provide proper support for it.
  14. Kier

    Kier XenForo Developer Staff Member

    There was only one person who ever really understood ImpEx (it wasn't me).
  15. Rudy

    Rudy Well-Known Member

    For that matter, I can not even comprehend how Jerry himself could remember all that he had written for ImpEx! ;)

    I do admit that I figured out enough to make minor modifications to the SMF2 and phpBB2 importers to make them work for my conversions to XF. Now if I could figure out that pesky old WebBBS module, I would almost start to believe that I know what I'm doing... ;)
  16. Jerry

    Jerry Well-Known Member

    I have a talent for picturing data in one shape and then how it gets into another shape, and keeps it's relationships I guess. ImpEx was a game to me for the most part :) ....... I would of likely enjoyed the chemical experiments of the 60's .......
    Forsaken likes this.
  17. Rudy

    Rudy Well-Known Member

    Why is Steely Dan's "Kid Charlemagne" going through my head right now? :D

Share This Page