Migrating from myBB to NodeBB postgreSQL

Ok, so I’ve recently upgraded my support forum from myBB to a NodeBB install. I’d like to stay it was easy - well it kinda was, but there were many steps, so I thought I’d quickly outline what i did.

The migration was a couple of weeks ago now - and not super fresh in my mind, so this is not a complete migration tutorial - more of an overview


Why did I do it?
Well to be perfectly honest, I like new things, and I’m all for changing things up if its a better fit. Also the myBB install I had was looking a little dated, and felt clunky to administor. MyBB is built on top of php, which I wanted to purge from my site, as it seems to be a large source of security headaches. So, it had to go!

My wordpress installs have also been migrated away to static sites built with Hugo for the same reason - and my entire site is now happily running sans php.

Why NodeBB

NodeBB seemed like a good upgrade path, as its built upon the modern Node.js runtime and is actively maintained with a super active support community. Theres also already a bunch of nice themes and plugins, and of course it is already built with mobile devices in mind.

Why PostgreSQL

Why not just use the default mongoDB install, and save the pain of another migration… Well I’m much more comfortable with postgreSQL and creating backups etc… so figured the extra work would be worth it.

Quick overvew of the process

There are a number of steps I took, but this was the basic formula.

  1. Export the myBB database
  2. install NodeBB
  3. Import the database with a conversion plugin
  4. Convert NodeBB to postgreSQL

I fired up a DigitalOcean droplet to do this all on, so I wouldn’t mess up my production server.

Step 1. Exporting the database

The easiest step of all, as I make database backups twice daily - so nothing needed to be done here.

Step 2. Install NodeBB

This is where things quickly get fiddly.
The importer plugin (nodebb-plugin-import) I need in the next step only works with version 1.7.5 of NodeBB. I also need to Install mongoDB as an intermediate db on my way to postgreSQL, and that is pretty easy by following this tutorial:

Installing NodeBB v1.7.5 is also super easy, and is outlined in the plugin’s documentation:

Step 3. Import the database with a conversion plugin

Also pretty simple, the importer is installed through the admin interface in NodeBB, and importing was pretty straight forward. I did forget to disable all other plugins (as mentioned in the readme), and this caused some headaches till i did.

I then upgraded to the latest version of NodeBB (1.10.2), which is also outlined here:

Now, I did run into some errors when trying to convert in the next step, so had to manually go in and clean up the mongo database before conversion. (In short the importer adds a number of non-standard tables which needed to be removed (mostly prefixed with an _ if i remember correctly))

4. Convert NodeBB to postgreSQL

Before installing the plugin and converting, I obviously needed to install postgreSQL:

Installing and running the converter is pretty straight forward and all documented:

5. Success!

Well almost, but not quite… there was still some cleanup to do, and this probably took the most time. Many of the imported posts had raw html blocks which had to be manually converted to markup. I did a lot of this via postgreSQL commands, but then quickly manually scanned through all the posts for anything i missed.

And last of all, I exported the database from my staging server, installed NodeBB, and imported the database into my production server. Next was setting up the categories just the way i like, and some theme adjustments to fit in with the rest of my site.

Finally, after i was happy with it all, I created an apache redirect to the new forum (which I installed on a subdomain), deleted myBB and it’s corresponding database.

In total, I think the migration took me an entire day, but Im pretty stoked with NodeBB so far and happy not having to deal with myBB any more.