README
nodebb-plugin-import-ubb
An esoTalk forum exporter to be required by nodebb-plugin-import, based on nodebb-plugin-import-ubb.
BEWARE
Might crash for large numbers of records, especially posts! Use at your own risk! (It’s MIT license anyway, so what do I care?).
Due to esoTalks database structure (and my poor MySQL skills) I wasn’t able to properly select the posts without the topic-starting posts in my query, so I have to detect and throw them out via javascript. Since I do not know how many of them will be there at query time, I can’t apply the limit to the query properly. Thus, all posts are selected everytime and the array is sliced in JavaScript after the starting posts are thrown out! Which means that, if you have a lot of posts in your forum, you might need a lot of ram to do this ...
What is this?
It's just an exporter of esoTalk Threads data, that provides an API that nodebb-plugin-import can use to export source forum data and import it to NodeBB's database. So, it's not really a conventional nodebb-plugin.
Why is it even a NodeBB plugin?
it doesn't really need to be, nor that you can use it within NodeBB it self, but, having this as a plugin have few benefits:
- a nodebb- namespace, since you can't really use it for anything else
- it can easily
require
NodeBB useful tools, currently
Usage within NodeJS only
// you don't have to do this, nodebb-plugin-import will require this plugin and use its api
// but if you want a run a test
var exporter = require('nodebb-plugin-import-ubb');
exporter.testrun({
dbhost: '127.0.0.1',
dbport: 3306,
dbname: 'ubb',
dbuser: 'user',
dbpass: 'password',
tablePrefix: 'ubbt_'
}, function(err, results) {
/*
results[0] > config
results[1] > [usersMap, usersArray]
results[2] > [categoriesMap, categoriesArray]
results[3] > [topicsMap, topicsArray]
results[4] > [postsMap, postsArray]
*/
});