Script to migrate a vBulletin board to a Flarum board
Based on a phpBB migration script by robrotheram from discuss.flarum.org
Author: George Lewe
License: MIT
Discussion: https://discuss.flarum.org/d/25961-vbulletin-to-flarum-migration-script
The current script only supports vBulletin 3.8.x.
The script assumes that both databases, vBulletin and Flarum, are on the same database server.
It will create all non-default vBulletin groups in Flarum. The first seven vBulletin groups will be skipped since they can be matched to one of the four default Flarum groups:
VBULLETIN | FLARUM |
---|---|
1 = Unregistered / Not Logged In | 2 = Guests |
2 = Registered users | 3 = Members |
3 = Users awaiting email confirmation | 3 = Members |
4 = (COPPA) Users Awaiting Moderation | 3 = Members |
5 = Super Moderators | 4 = Mods |
6 = Administrators | 1 = Admins |
7 = Moderators | 4 = Mods |
It will create all vBulletin users in Flarum with fields
- username
- is_email_confirmed = 1
- joined_at
- last_seen_at
The passwords will NOT be copied. Instead it will create a random passowrd which is a md5 hash of the current time that is then shad1. This means after the migration all users will need to reset their passwords.
It will then create the group_user tabel entries with the appropriate group IDs from step 1.
It will read the vBulleting forum records and create corresponding tag records in Flarum with fields:
- id
- name
- description
- slug
- color
- position
- last_posted_at
- last_posted_user_id
- discussion_count
It will read the vBulletin Threads and their Posts and create the appropriate Flarum Discussions and Posts.
Discussion fields:
- id
- title
- slug
- created_at
- comment_count
- participant_count
- first_post_id
- last_post_id
- user_id
- last_posted_user_id
- last_posted_at
Post fields:
- id
- discussion_id
- created_at
- user_id
- type
- content
The posts will then be linked to the appropriate discussions.
It will link discussions with users that have contributed to them.
It will count discussions and comments for each user and save them accordingly.
It will sort the tags created in step 3 in alphabetical order (since there is no feature yet in Flarum to configure their display order).
- The script will not copy/maintain the vBulletin passwords. Instead it will create a new random passowrd which is a md5 hash of the current time that is then shad1. This means after the migration all users will need to reset their passwords.
- The script will not perform a thorough conversion of code used in the vBulletin posts and names. Some might not look the same in Flarum but I found it close enough.
- Install a local web server with a MySQL database server (e.g. XAMPP)
- Create a local copy of your vBulletin board database (export from production).
- Install a fresh Flarum forum using the same database server.
- Export the fresh Flarum database into a file with option "Drop if exists" and disabled foreign key check (for later re-import if you want to run the migration again with your own customizations).
- Edit my script and change the database settings to your local environment.
- Run the script. It will output information to the console telling you what is going on and what errors occurred.
If something went wrong and you want to start over:
- Re-import the Flarum database
- Recreate the Flarum database with the same name.
- Import the fresh Flarum database that you exported after the Flarum installation.
- Make the changes to the script that you desire (e.g. skipping certain sections)
- Run the script again
I hope this helps. Enjoy.
George
Thanks to all who have contributed