This is a script that will import contents of the database of an Unclasified Newsboard forum into a Flarum database.
This has been tested with Flarum 0.1.0-beta.12
and UNB 20150713-dev
.
- Forums -> Tags
- Threads -> Discussions
- Posts -> Posts
- Users -> Users
- Groups -> Groups
You need to start with a completely empty Flarum database. You should delete the default "General" tag before importing.
Your UNB and your Flarum database need to be in the same MySQL/Maria server and you need a database user that can access both databases. This is needed because I run some queries that execute things in both databases at once.
You need to install and activate the following extensions in Flarum:
- Old Passwords to let users login with their old UNB passwords
- User Bio to let users have a biography field again
- Masquerade to import additional profile data
Check out this repository, then install the dependencies:
composer install
Copy the provided config.php
and edit it for your setup.
cp config.php myconfig.php
vim myconfig.php
Then run the converter
php unb2flarum.php -c myconfig
The whole import is executed with a transaction. If something goes wrong, nothing will be committed to your Flarum database. You might want to do a dump of your empty setup beforehand anyway, in case you want to tweak and rerun the import again.
This currently does not support Polls. There is a poll extension for Flarum, but the feature was so rarely used in my UNB that I simply didn't bother with it.
Categories aka Forums aka Tags can be nested arbitrarily deep in UNB. Flarum treats them more like tags and also allows nesting for two levels only. I assume that you may want to restructure your categorisation for Flarum anyway, so all categories are importet as first level tags. Rearrange them as you see fit.