Converting from a custom made UserDB

Converting from other board software? Good decision! Need help? Have a question about a convertor? Wish to offer a convertor package? Post here.
Registered User
Posts: 1
Joined: Thu Oct 15, 2015 10:25 pm

Converting from a custom made UserDB

Post by Northcode » Thu Oct 15, 2015 10:43 pm

Hey, guys

So my current situation is I have a few websites which work with a custom userdb including a custom auth API so all my websites can login with the same credentials.

The current userdb looks somewhat like this

Everything is plaintext but the password which is custom hashed and irreversible.

So what are my best options? Is it possible to fully migrate this to phpBB or should I adapt phpBB to use my auth system? And whichever is better, where would I start off doing that?
I've seen some stuff on the Knowledge base but couldn't find anything specific regarding this. I'm quite new to forums and their db structure and I would greatly appreciate if someone could point me in the right direction.

Registered User
Posts: 13
Joined: Wed Nov 25, 2015 4:42 pm

Re: Converting from a custom made UserDB

Post by AesirHod » Mon Dec 14, 2015 11:11 am

I'd auto-generate new passwords and email them en masse to the users email addresses with instructions to update them immediately. If there are users without email addresses (I wouldn't expect there to be), you could maybe add a notice on your old message board to provide one in order to keep the username on the new message board.

Is this custom DB a customized phpBB or entirely different type of message board? I'd be interested to see your progress as I'm trying to do something similar myself.

User avatar
Posts: 185
Joined: Fri Oct 13, 2006 1:16 pm

Re: Converting from a custom made UserDB

Post by gn#36 » Mon Mar 07, 2016 3:25 pm

Actually, converting your passwords should be fairly easy. phpBB supports multiple different algorithms already and adding another one is quite simple, at least assuming that you know how to program the convertor. phpBB itself has used different algorithms in the past for different versions and automatically converts old and obsolete algorithms to new ones whenever the user logs in. You can also use that mechanism to convert your passwords to phpBB ones.

Essentially, you need to program a new class that implements phpbb\passwords\driver\driver_interface. You can find that in the folder phpbb\passwords\driver of any phpBB installation. In that folder, you can also have a look at existing drivers. phpBB has more than one, maybe your algorithm is already there if it is a common one. In any case you can have a look at them to see how it is done.

The new class needs to be present in your phpBB installation and takes care of handling your old style passwords. The method descriptions should be pretty self explanatory on what the class should do. If you set it to "legacy", phpBB will automatically do the conversion for you on login. Besides programming the class, you will need to make it available to phpBB (e.g. in an extension) in a service.yml in the same way as the other passwords drivers (have a look at config/passwords.yml). For the conversion itself you then only need to prefix your old passwords with a distinct identifier before copying it to the phpBB database, so phpBB knows when to use your class instead of default phpBB ones.
German Support Team Member • http://www.phpbb.deMy Extensions in the CDBMy Extensions on Github • Contact with caos is inavoidable but no catastrophy if you keep an overview.


Return to “[3.1.x] Convertors”