vBulletin Import Script - Group, Forum Mappings


(James Cook) #1

Hi

I would like to use the new vBulletin import script but I’m just wondering what CSV files are expected for group and forum mappings? Sorry if I’m being a bit dumb.

It’s pretty obvious that it’s expecting CSV files from the user, usergroup, forum, thread and post tables but as far as I’m aware there are no group mapping or forum mapping SQL tables. I’m running VB4.

Any help would be very much appreciated! :thumbsup:


Migrating from Invision Power Board to Discourse
(Régis Hanol) #2

First, these files are optional. The import should run properly withouth them :wink:

This was done because our customer needed to remap groups/forums from vBulletin into different groups/categories in Discourse.

Here’s an example for forum-mapping

old_id,new_id,new_name
439,439,Community
9,439,Community
444,439,Community
12,12,Reviews

With that mapping, the forums with id 439, 9 and 444 will all be merged into one category named Community. The forum with id 12 will be kept as is and renamed to Reviews.

And here’s an example for group-mapping

old_id,new_id
2,72
30,72
72,72
5,5
6,6

Same principle minus the new_name column.

:warning: If you do use the mapping files, groups/forums that aren’t mapped will not be imported. :warning:


(James Cook) #3

Ok great. Makes a lot more sense now. Will have a go at the weekend and get this working. Thanks!


(Ali) #4

Are there any how to instructions to follow for the vbulletin import script? Does it work with vbulletin 3?


(James Cook) #5

Type rails runner script/import_scripts/vbulletin.rb into your terminal in the Discourse directory and it will give you a list of options you need to pass in.

You will need to generate .csv files from your current database for the script to read from.


(James Cook) #6

Unfortunately, I ran into problems when trying to run the script without forum and group mappings.

However it isn’t a big problem. I’m amending the code and will put a pull request in once I’ve finished.

I have run into one problem though that is unrelated that you might be able to help me with…

I’m getting this error with one of my CSV files and was wondering if you’ve come across it before?


(Régis Hanol) #7

(Off the top of my head) you should try to run this regex to fix your CSV file

  • search: $\n\\n
  • replace: \\n

(James Cook) #8

Thanks. Is there a quick way to see new line characters? I’ve opened up the file in Sublime and Vim and even with invisible characters set to true I can’t see any.


(James Cook) #9

Ignore me. Will just do it in the code when I grab the data from the file.


(James Cook) #10

Ok, still struggling to get this to work.

I can parse the data fine if I remove these parsing options:

{ col_sep: "\t", quote_char: "\u200B" }

Not sure why as every other file is working and I generated them all the same way. It’s bed time for me but if you have any thoughts I would appreciate it! :smile:


(James Cook) #11

Update:

Turns out that the new lines in some of my posts are causing an issue. At least that’s what I think it is. Don’t have time to investigate much today but will keep working on this. Wondering if { col_sep: "\t", quote_char: "\u200B" } is really needed @zogstrip?


(Régis Hanol) #12

That’s what I needed from the exports I worked on. Totally open to make that optional if needed :wink: