[nodebb-plugin-import-phpbb] phpBB2 to NodeBB converter

NodeBB Plugins
  • Based off of @bentael's UBB converter (literally, copy paste for 75% of it, so thanks! :)). See his plugin for detailed instructions on how to use, as some modification to your core is required to optimize the import process.

    Get it on GitHub

  • @psychobunny Thanks, this looks exactly like what I need. Can I import a SQL dump that the PHPBB2's Export Database spits out?

  • @Guiri The plugin connects directly to a database to export, so you could set your old host up to allow MySQL Remote, or if not...

    Export the database as an sql file and upload it to your root directory. Then run

    sudo apt-get install mysql-server
    mysql -u root -p
    <insert password you created
    USE phpbb;
    source phpbb.sql

    Then when you edit config.sample.json in the plugin, just do localhost, root, the password you set up, and phpbb as the database name.

  • @a_5mith Awesome, thank you for the example code.

  • @Guiri No problem, you will also need nodebb-plugin-import to get your conversion data into nodebb. When you run that, change the storage location in the example to $HOME/Desktop/Storage instead of ../Storage

  • Giving this a huge bump.
    Currently struggeling to get a phpBB 3.0.X version migrated.

    1. Which plugin shall I use actually? There are so many versions of the phpBB importer available.
      Personally I have tested this and the 3.1 one.

    2. These two returnt the following

    2018-07-07T10:17:11.049Z [7323] - error:  message=Cannot find module '/home/web/nodebb/nodebb-plugin-import-phpbb'
    Cannot find module './build/index.js', stack=Error: Cannot find module '/home/web/nodebb/nodebb-plugin-import-phpbb'
    Cannot find module './build/index.js'
        at nodebbRequire (/home/web/nodebb/node_modules/nodebb-plugin-require/index.js:72:10)
        at safeRequire (/home/web/nodebb/node_modules/nodebb-plugin-import/server/exporter/index.js:41:9)
        at searchModulesCache (/home/web/nodebb/node_modules/nodebb-plugin-import/server/exporter/index.js:24:13)
        at reloadModule (/home/web/nodebb/node_modules/nodebb-plugin-import/server/exporter/index.js:47:3)
        at /home/web/nodebb/node_modules/nodebb-plugin-import/server/exporter/index.js:556:24
        at cb (/home/web/nodebb/node_modules/npm/lib/install.js:253:18)
        at /home/web/nodebb/node_modules/npm/lib/install.js:351:7
        at LOOP (/home/web/nodebb/node_modules/npm/node_modules/slide/lib/chain.js:7:26)
        at /home/web/nodebb/node_modules/npm/node_modules/slide/lib/chain.js:18:7
        at tryCatcher (/home/web/nodebb/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
        at Promise.successAdapter [as _fulfillmentHandler0] (/home/web/nodebb/node_modules/npm/node_modules/bluebird/js/release/nodeify.js:22:30)
        at Promise._settlePromise (/home/web/nodebb/node_modules/npm/node_modules/bluebird/js/release/promise.js:566:21)
        at Promise._settlePromise0 (/home/web/nodebb/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
        at Promise._settlePromises (/home/web/nodebb/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
        at Async._drainQueue (/home/web/nodebb/node_modules/npm/node_modules/bluebird/js/release/async.js:133:16)
        at Async._drainQueues (/home/web/nodebb/node_modules/npm/node_modules/bluebird/js/release/async.js:143:10)
        at Immediate.Async.drainQueues [as _onImmediate] (/home/web/nodebb/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)
        at runCallback (timers.js:810:20)
        at tryOnImmediate (timers.js:768:5)
        at processImmediate [as _immediateCallback] (timers.js:745:5)

    It seems like both versions are heavily outdated. Would be great, if I could be spared a conversion from phpBB to SMF to NodeBB.

    1. Shall I use an older version of NodeBB maybe to perform the import?
      What was the last one known to be working with this plugin? 0.6 or 0.7?

Suggested Topics

  • 0 Votes
    6 Posts

    @DownPW said in [nodebb-widget-board-stats] discrepancy to dashboard count:

    any news @murcs ?

    i just digged a little deeper for you: „our“ /var/www/nodebb/node_modules/nodebb-widget-board-stats/library.js looks like this

    'use strict'; const async = require('async'); const nconf = module.parent.require('nconf'); const db = require.main.require('./src/database'); const user = require.main.require('./src/user'); const utils = require.main.require('./src/utils'); const socketPlugins = require.main.require('./src/socket.io/plugins'); const socketRooms = require.main.require('./src/socket.io/admin/rooms'); let app; const Widget = module.exports; Widget.init = function (params, callback) { app = params.app; callback(); }; socketPlugins.boardStats = {}; socketPlugins.boardStats.get = function (socket, tid, callback) { getWidgetData(callback); }; function addDots(text) { return String(text).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1.'); }; function getWidgetData(callback) { async.parallel({ global: function (next) { db.getObjectFields('global', ['topicCount', 'postCount', 'userCount'], next); }, latestUser: getLatestUser, activeUsers: getActiveUsers, onlineUsers: Widget.updateAndGetOnlineUsers, activeWithin24h: function (next) { var now = Date.now(); db.sortedSetCount('users:online', now - 86400000, '+inf', next); }, }, function (err, results) { if (err) { return callback(err); } var data = { within24h: results.activeWithin24h, count: addDots(results.onlineUsers.onlineCount + results.onlineUsers.guestCount), members: addDots(results.onlineUsers.onlineCount), guests: addDots(results.onlineUsers.guestCount), list: joinUsers(results.activeUsers), posts: addDots(results.global.postCount ? results.global.postCount : 0), topics: addDots(results.global.topicCount ? results.global.topicCount : 0), registered: addDots(results.global.userCount ? results.global.userCount : 0), latest: joinUsers(results.latestUser), relative_path: nconf.get('relative_path'), mostUsers: { date: (new Date(parseInt(results.onlineUsers.timestamp, 10))).toDateString(), total: results.onlineUsers.total, }, }; callback(null, data); }); } function getActiveUsers(callback) { async.waterfall([ function (next) { user.getUidsFromSet('users:online', 0, 19, next); }, function (uids, next) { user.getUsersFields(uids, ['username', 'userslug', 'status'], next); }, ], function (err, data) { if (err) { return callback(err); } data = data.filter(function (a) { return a.status === 'online'; }); callback(err, data); }); } function getLatestUser(callback) { async.waterfall([ function (next) { user.getUidsFromSet('users:joindate', 0, 0, next); }, function (uids, next) { user.getUsersWithFields(uids, ['username', 'userslug'], 0, next); }, ], callback); } function joinUsers(usersData) { var str = []; for (var i = 0, ii = usersData.length; i < ii; i++) { str.push('<a href="' + nconf.get('relative_path') + '/user/' + usersData[i].userslug + '">' + usersData[i].username + '</a>'); } return str.join(', '); } Widget.updateAndGetOnlineUsers = function (callback) { callback = typeof callback === 'function' ? callback : function () {}; async.waterfall([ function (next) { next(null, socketRooms.getLocalStats().onlineRegisteredCount); }, function (onlineCount, next) { socketRooms.getTotalGuestCount(function (err, guestCount) { if (err) { return next(err); } next(null, { onlineCount: parseInt(onlineCount, 10), guestCount: parseInt(guestCount, 10), }); }); }, function (users, next) { db.getObjectFields('plugin:widget-board-stats', ['total', 'timestamp'], function (err, data) { if (err) { return next(err); } var totalUsers = users.onlineCount + users.guestCount; data.timestamp = data.timestamp || Date.now(); if (parseInt(data.total || 0, 10) <= totalUsers) { data.timestamp = Date.now(); data.total = totalUsers; db.setObject('plugin:widget-board-stats', data); } data.onlineCount = users.onlineCount; data.guestCount = users.guestCount; return next(null, data); }); }, ], callback); }; Widget.renderWidget = function (widget, callback) { getWidgetData(function (err, data) { if (err) { return callback(err); } app.render('widgets/board-stats', data, function (err, html) { if (err) { return callback(err); } widget.html = html; callback(null, widget); }); }); }; Widget.defineWidgets = function (widgets, callback) { var widget = { widget: 'board-stats', name: 'Board Stats', description: 'Classical board stats widget in real-time.', content: 'admin/board-stats', }; app.render(widget.content, {}, function (err, html) { widget.content = html; widgets.push(widget); callback(err, widgets); }); };

    which corresponds with our localized version of /var/www/nodebb/node_modules/nodebb-widget-board-stats/public/templates/widgets/board-stats.tpl

    <div component="widget/board-stats" class="widget-board-stats" style="border: 1px solid #999"> <h3 style="background: #666; font-size: 15px; font-weight: 500">Folgende Nutzende sind gerade online: <a href="{config.relative_path}/users?section=online">[komplette Liste]</a></h3> <p> Davon sind aktuell <strong component="widget/board-stats/count">{count}</strong> Nutzende aktiv (<strong component="widget/board-stats/members">{members}</strong> Registrierte + <strong component="widget/board-stats/guests">{guests}</strong>G&auml;ste).<br /> <span style="display: block; line-height: 0.5em" >&nbsp;</span> <span component="widget/board-stats/list">{list}</span> <span style="display: block; line-height: 0.5em" >&nbsp;</span> In den letzten 24 Stunden waren <strong component="widget/board-stats/within24h">{within24h}</strong> verschiedene Nutzende eingeloggt. </p> <h3 style="background: #666; font-size: 15px; font-weight: 500">Forum-Statistik</h3> <p> Unsere aktiven registrierten Mitglieder haben <strong component="widget/board-stats/posts">{posts}</strong> Beitr&auml;ge zu <strong component="widget/board-stats/topics">{topics}</strong> Themen verfasst &ndash;<strong component="widget/board-stats/registered">{registered}</strong> Mitglieder sind bei <em>schoenen-dunk.de</em> registriert.<br /> <span style="display: block; line-height: 0.5em" >&nbsp;</span> <span component="widget/board-stats/latest">{latest}</span> ist unser neuestes Mitglied.&nbsp;Herzlich Willkommen!<br /> <span style="display: block; line-height: 0.5em" >&nbsp;</span> Am {mostUsers.date} waren <strong>{mostUsers.total}</strong> Nutzende gleichzeitig online. </p> </div>

    well.  i hope this helps a bit.

    ober!schöne grüße,

  • 4 Votes
    4 Posts

    Finaly managed to fix 502, needed to use node v4 instead of v6.

    Still having an issue with this plugin when i try to login :

    Registration Error int-steam-unexpected-error
  • 1 Votes
    3 Posts

    Has anyone looked at this plugin recently? Is it still working or being supported? Would love to be using it.

  • 3 Votes
    3 Posts

    I have tried this plugin 1.2.0 buy it doesn't works. Maybe I did something wrong or maybe it is too old. Anyone can confirm this plugin is outdated?