Converting from SMF to ExpressionEngine Forum

The SMF_Import module I’ve created can be used to import both users and forum messages to EE, or just the users if you only want to import these.
Please note that the module you can download here (SMF_Import) is not a full module release, but more like a ‘scratch-an-itch’ plugin I created to solve my specific problem (converting my forum) – so you will need to do some editing to get it to work. The good news is – it worked for me, and it’s not too difficult. Also, if you have problems, just leave me a comment and I’ll try to help you.

Make sure you have EE set to use standard MD5 password encryption (you do this during install). Also note that since SMF uses a seed the passwords cannot be transferred and all your users, including you, will have to go through the forgot password procedure.

How to do it

Downloading the SMF Import module

Unzip it in a directory – and open mcp.smf_import.php in a text editor

Edit some settings

At the beginning in mcp.smf_import.php there are a couple of settings:

var $smf_db = "database_name";
var $smf_prefix = "smf_";

Pretty self-explanatory. The smf_prefix is the simplemachines database table prefix (smf_ is standard).

Creating the usergroups

Go to EE Admin -> Usergroups and create the usergroups you want. These may be the same groups you already have in your SMF install, or new ones. The point is that you want to transfer people from to . In my case my SMF install was very messy and I had a lot of different groups – so I ended up with just a few EE groups which was much more managable :)

Go to SMF Admin and check out the usergroups you have there. Now it’s time to link the SMF groups to the EE groups. You already have mcp.smf_import.php open I presume? You need to edit the array around line 90:

Also, right above that array there are some settings. Please go over them as well:

$admin_id = 1; // we don't want to insert a new admin, but update the exisitng EE admin with data from SMF
$update_only = false; // default = false, set to true if you run more than one time and only want to update users
$time_format = 'eu'; // default timeformat for the users
$language = 'english'; // default language for the users

Creating the forums

The process is the same for the forums as for the usergroups.

Go to the forum administration and add the forums you already have on your old forum (or, new ones, the most important thing is that you have somewhere to transfer the old messages). Make a note of the forum database IDs

Installing the module

Now that we have everything customized for our need, we’re ready to upload the module.

Copy the mcp.smf_import.php file to modules/smf_import

Copy the lang.smf_import.php to language/

Click “Install” like you usually do with modules

Voilá – and on to the next step:

Importing the users

Go to the “Modules” tab in EE admin

Ok, this might seem a bit weird, but I told you it was scratch-an-itch software so — for some reason you won’t get a clickable “SMF Import” link. Thus, click one of the other modules (e.g. Referer) and replace the end in the URL (e.g. “M=Referer”) with “M=smf_import” –> then you should see the SMF import dialog ;-)

To import the users click “Import SMF users”. This will be a memory intensive operation! (I converted 3000 members and needed to ask my host to up my ram during the operation, anyway).

You should now have imported all users.

Importing the forum posts

Go back to the SMF_import dialog and click “Import forum posts”.

Go to EE Admin tools and run all the “recount statistics” stuff for members and forum ;-)

That’s it.

Enjoy :-)

You can do whatever you want with this script – if you do decide to improve it please drop me a note so I can let everyone know :-) (e.g. one good idea would be to do the users convert in batches instead of all at once).

As a last note – I’ve converted my forum from InvisionBoard, then to phpBB, and finally to SimpleMachines. So, whatever you’re using it should be possible to do the convert (just search around for converters from those others to SMF and use this from SMF to ExpressionEngine. Yes, it’s quite a task but it’s possible ;-)

And if I saved you some time and you feel like buying me a beer my PayPal account is [email protected] :-)

Thank you very much for this script. It helped me tons! I was very worried about this element of the transition. I love it when people post the solution to their own problem. I think it really helps people learn. Too bad not everyone does it. There would be much more sanity and much less computer pieces.

The reason your link is not activated in the EE modules list in the control panel is because in the code at lines 448, 553, 559, 562 and 565 you are not using the class name. Instead you are using the $module_name which is incorrect.

I had a similar problem while devoping another module. Hope that helps.

Sorry, just to make that a little clearer! The value to be used in the lines mentioned above would be ‘Smf_import’ which is the class name in the mod file, not the class name in the control panel file.

Chris – I would just delete the banned users in SMF before importing, seems like the easiest solution to me.

That said, SMF must have some way of knowing what users are banned (maybe a specific usergroup?), so it should only be a matter of a couple of SQL-statements to make them banned in EE after transferring.

btw – thanks for the solution to my link-problem :) I don’t think I’ll bother updating/testing this script, since as I stated it’s not a module release but just a fix for my specific problem. But now I know for next time. thanks.