Resource icon

vBulletin 5 to Xenforo Importer 1.1.414.1

No permission to download
It appears that it is duplicating my document root path. Should only be one /dev in there, but its looking in /dev/dev, which doesnt exist. I tried a few variation, and tried even just leaving it blank, but cant seem to get it to work. Any idea what I am doing wrong here?

It looks like you might have defined it incorrectly on line 8, perhaps you put /dev there for your document root? Try leaving it as / in that case and it should correct the issue.
 
@Necrophyte I finally had a day to myself and was determined to figure out the reason that your script wouldn't import attachments. Some of it had to do with permissions, and another error was corrected by manually creating a directory that it was looking for. However, I've run up on the end of my ability. Running the script gives me a large number of the following error:

Code:
Notice: Undefined offset: 1785 in /home/<serverpath deleted>/convert_vb5_to_xenforo.php on line 1533

What varies is the offset number (1785 in the example), it's different in every error. Tracing that down, it's a reference to the user ID of whomever made the post. A reference to 'user_id' comes up a few times:

Code:
Line 619: $writer->set('user_id', $row['userid']);
Line 646: $userId = $writer->get('user_id');
Line 1033: 'user_id'=> $row['whoadded'],
Line 1093: $member_names[$row['user_id']] = $row['username'];
Line 1113: 'user_id'=> $member_conversion[$userid],
Line 1220: $member_names[$row['user_id']] = $row['username'];
Line 1306: 'user_id'=>$sRow['userid'],
Line 1503: $VB_filepath = VB_ROOT.VB_ATTACH.implode('/', preg_split('//', $row['user_id'], -1, PREG_SPLIT_NO_EMPTY))."/".$row['filedataid'].".attach";
Line 1533: ('".$member_conversion[$row['user_id']]."',

My only guess here is that possibly where it's in there as 'userid' instead of 'user_id' that's a typo? Not sure how to proceed from there, hopefully that's enough information.
 
It looks like you might have defined it incorrectly on line 8, perhaps you put /dev there for your document root? Try leaving it as / in that case and it should correct the issue.

Thanks, Ya I tried that and still gives me an error, although a totally different error
Warning: mysqli_connect(): (HY000/2002): No route to host in /home/marinecolorado/public_html/dev/convert_vb5_to_xenforo.php on line 149

Fatal error: Call to a member function query() on boolean in /home/marinecolorado/public_html/dev/convert_vb5_to_xenforo.php on line 150
 
Thanks, Ya I tried that and still gives me an error, although a totally different error
Warning: mysqli_connect(): (HY000/2002): No route to host in /home/marinecolorado/public_html/dev/convert_vb5_to_xenforo.php on line 149

Fatal error: Call to a member function query() on boolean in /home/marinecolorado/public_html/dev/convert_vb5_to_xenforo.php on line 150

The second is happening because of the first. That one looks like it can't find your database server...might check to make sure you have that server and port information correct?
 
Ya I have verified I can login to the DB with the IP and creds I put in the config. Does it need the port number? I just have the IP address currently, maybe i just need to add a port to the number?
 
I am trying to convert a VB 5.3.2 board to XF 1.5.15. I am getting this error: Fatal error: Uncaught Error: Call to a member function fetch_assoc() on boolean in /home/xxxxx/public_html/convert_vb5_to_xenforo.php:225 Stack trace: #0 {main} thrown in /home/xxxxx/public_html/convert_vb5_to_xenforo.php on line 225. My vbulletin database has a table of prefix XXX_ could that have anything to do with it.
 
Yes.
Make sure your putting the entire name with the prefix for your database..
So if the prefix is prime_ and the database name is vBulletin. Enter prime_vBulletin as the database name
 
The table names are prefixed with xxx_ so the database would be vBulletin and the first table is xxx_action.

BTW, thanks for the help and script.
 
Ahh. I understand what you meant now. Sorry its been a while for vBulletin for me.
I never really went through and made it handle prefix's.
You'd have to go through and search for all the instances of VB_DB_NAME an dwhere you see .tablename change it to have .prefix_tablename

Not difficult to do, but tedious.
 
Fatal error: Uncaught Error: Call to a member function fetch_assoc()
Means its not connected to the database, or the query returned nothing. It would return nothing because your tables are missing the prefix.
You can either remove the prefix from all 300+ Tables vBulletin uses. Or change the code :)
At this point I'm not really sure which would be easier. I almost think changing the tables names to remove the prefix would be faster.

Make sure you back everything up first. The code won't change your DB but changing the DB prefix will stop vBulletin from working.
 
Thanks for the script!

I end up with a 404 not found error when hitting the convert links:
URL shows as */convert_vb5_to_xenforo.php?bbcode

Any ideas?

I'm running nginx / php7.0. The .php section of my vhost looks like below:

NGINX:
location ~ \.php$ {
             try_files $uri =404;
             include /etc/nginx/fastcgi_params;
             fastcgi_pass unix:/run/php/php7.0-fpm.sock;
             fastcgi_index index.php;
             fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
 
Last edited:
Thanks @Necrophyte. Next up: after skipping users with ',' and '@' in their names, At various points during the import process, the error below appeared before the import continued:

Notice[/B]: Undefined offset: 8 in *[B]/convert_vb5_to_xenforo.php[/B] on line [B]628

The script reports I've imported "8575/8582" members. At this point, no 'convert' button pops up next to 'Forums'. What's the next step here?
 
Likes shows various 'notices' below as well:

Notice[/B]: Undefined offset: 6624 in [B]/convert_vb5_to_xenforo.php[/B] on line [B]1044 Notice[/B]: Undefined offset: 391 in [B]/convert_vb5_to_xenforo.php[/B] on line [B]1044 Notice[/B]: Undefined offset: 185 in [B]/convert_vb5_to_xenforo.php[/B] on line [B]1044

The main blocker issue I'm running into now is threads. Threads are all shown as being successfully imported, however nothing appears in Xenforo. The xf_thread database table is empty. No errors are thrown during importing. Any ideas on how to debug?

Thanks.
 
Likes will show that.. vBulletin doesn't delete likes when you delete a post. They are separate in the DB. So the code is just saying it couldn't find the post to link the like to. Will especially give that if the posts are not set up, which cant be if the threads are not set up.

As for threads not showing?
There is a thread count? It should say X threads of Y on the main display.
Did you do the forums first?
Must do in order Forums, Threads, Posts, then likes, attachments etc doesn't matter after posts.
If the forums are missing. The threads will be to since the thread is linked to a forum. Same for posts, post won't show unless there is a thread to link to etc etc.

So do the forums first. Then Check to see if they are there.
Then do Threads. Check to make sure they are there.
Then do Posts. Make sure they are there. Posts will seem to be all on one page.
To Fix this. Go to the admin, tools, rebuild cache, Scroll till you see rebuild thread information. There will be a check box [ ] Rebuild position and post counters. Click that and then rebuild now. Once that is finished it will have them per page again.


If for whatever reason threads are not there. Let me know the vBulletin version you are running. They may have changed the database slightly. Though if the counter is telling you a number, it should be working. Threads should take about 2 - 10 min to run. If its instant something is wrong. I can give you some things to test should that be the case, but this will also report 0 of Y threads on the main dash.
 
Thanks for info on the notices.

Threads not showing:
- Correct order followed, per your reply
- Forums all exist
- The thread count shows all threads importing OK.
- xf thread database table is empty
- Post database table looks correct
- See screenshot attached for view of script's page.
- Import of 'threads' was instant.

I'm running vBulletin 5.3.3.
 

Attachments

  • Screen Shot 2017-11-11 at 5.35.19 PM.webp
    Screen Shot 2017-11-11 at 5.35.19 PM.webp
    27.8 KB · Views: 4
Thats really odd. The xf_thread is empty, but it wrote all the info to the translator properly.
So couple of options;
First. Lets see if this works.. Change threads per cycle on threads to 500. And run it again.. See if there is still nothing in the xf_thread table.
If this still didn't work.
Can you look for this line .. $mysqli_xf->query($thread_query);
Should be around the 867 mark.
Just before it, write these 2 lines.
echo $thread_query;
exit;

Then run the thread conversion. It should spit out a really long query.
Copy and paste that query and run the query yourself. Let me know what the error says. If any. If it runs the query.. Check it, and see if it wrote to the xf_table.
 
Top Bottom