Migrate a vBulletin 4 forum to Discourse

I know this is a bit of an old topic, but I’ve just completed a comparably sized vb4 migration and am missing a LOT of image attachments, somewhere on the order of 75% of them I’d wager. They are not tombstoned, and all the threads have been rebaked.

Has anyone else dealt with this? How should I go about recovering those images?

Did you see errors when you did the import?

1 Like

Yes, quite a few ‘Attachment file doesn’t exist’ errors with some ‘Couldn’t find attachment record for post.id=xxx, import_id=xxx’ sprinkled in.

The thing that has me scratching my head is that these are posts that I know have intact attachments, and that those attachments are in the ATTACHMENT_DIR global directory. The threads with missing images are missing ALL the associated images, which seems… not random.

I’m at a loss to find any common factor among the threads/posts with lost images either.

Those messages were your clue that something was amiss. All you can do is diagnose the problem an run the import again.

Every import is a snowflake. I’ve don’t dozens of them. It’s rare that one just works. If you’d like help: Discourse Migration – Literate Computing, LLC

2 Likes

I wanted to give Discourse a whirl by converting our substantial VBulletin database so giving this script a try.

It’s imported users and groups, but failed a couple of times now on sub categories.

   importing top level categories...
        7 / 7 (100.0%)  [902 items/min]   n]
importing children categories...
Traceback (most recent call last):
        5: from script/import_scripts/vbulletin.rb:942:in `<main>'
        4: from /home/peterb/discourse/script/import_scripts/base.rb:47:in `perform'
        3: from script/import_scripts/vbulletin.rb:84:in `execute'
        2: from script/import_scripts/vbulletin.rb:287:in `import_categories'
        1: from script/import_scripts/vbulletin.rb:287:in `each'
script/import_scripts/vbulletin.rb:289:in `block in import_categories': undefined method `[]' for nil:NilClass (NoMethodError)

I’ve checked various things like UTF8 encoding, server resources etc - but I’m at a bit of a loss now what else to check.
Any ideas?
Ta.

I’m running an 8M post vbulletin import right now. I’ve added support for likes (apparently some plugin or modification) and polls.

I can’t quite tell from the error what the problem is. My guess is that it’s somehow not finding a parentid.

I think that you need to somehow fix

    parent_category_id: category_id_from_imported_category_id(category["parentid"])

so that it doesn’t fail if category['parentid'] is nil.

1 Like

Thanks. I’ve taken another look and it looks like the admins created “sections” of categories by setting the parent ID to be -1…which does not exist.

3 Likes

Yup. Sounds like you figured it out. Having stuff like that go wrong is far more the norm than the exception. Then you have to figure out whether to fix it in the database or fix the code to deal with your broken database.

3 Likes

Usual thing with any data migration, whatever script you find will never cater for all eventualities. It doesn’t help that the only time I’ve got spare to work on this seems to be late at night, (it’s a freebie for my car club). The vBulletin site is pretty heavily customised so I’ll see what other surprises come up.

4 Likes

I can understand that there is a script who can handle the vbulletin 4 imports but I don’t see anything in regard with all URLs being redirected to the new discourse URL format.

How do you guys handle this? What happens with all the outside links your forums have?

Here it is:

https://github.com/discourse/discourse/blob/master/script/import_scripts/vbulletin.rb#L346-L359

3 Likes

Thank you @RGJ , but can you explain how does this work in real life? what is this script exactly doing? it creates some kind of alias URLs (in discours) to current/correct discourse imported URLs?

How would you recommend to move an old domain on Vbulletin (www.example1.com) to a new domain on discourse (www.exmple2.com)

I think, somehow ideal it would be the old forum domain to redirect all the incoming traffic/links to the new domain based on a list of 301 rewrites. How would you recommend to make such a redirect rewrites list?

You don’t need to change domains, but if you do then there is a two-step process.

  1. redirect EVERYTHING from the old domain to the new one
  2. Discourse permalinks will translate the vBulletin-style URLs to the correct Discourse topics.

If you don’t change domains but just point it to the new Discourse setup, then you only have #2 .

1 Like

how are the discourse redirects http headers 301, or 302?

I ma interested from the SEO pespective if a change of domain will affect the rankings

301 Moved Permanently

The word permalink says it all :slight_smile:

1 Like

You can see for yourself if you visit /admin/customize/permalinks and create a permalink to see how it works.

I have an issue with attachments not importing completely, similar to what has been mentioned before but the script is not putting out any errors.
The database is small (71M) and the entire import finishes in 0min 23seconds.
ss
A majority of attachments are missing from the posts.
I ran the SQL queries on my vb4 database directly as they are in the script and they are returning the correct data, so I am not sure where the problem is at this time…

Are the missing attachments not directly linked in the posts? I believe the script pulls only the images that are mentioned in the posts, not those that are merely attached to the post.

I have a script that imports those but haven’t yet managed to submit a PR.

Yes I think you’re right @pfaffman , that is indeed the case.
I’ll be awaiting that script when you get it uploaded!

If you’ve got a budget, let me know. I intend to submit a version after I finish this import, but I need to remove a fair amount of code that’s just for this import, which is why it didn’t happen a year ago…

1 Like