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
- Download the module here: smf_import.zip
- 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:
// link SMF membergroups to EE membergroups ... SMF_MEMBERGROUP_ID => EE_MEMBERGROUP_ID $smf_ee_membergroup_link = array( 0 => 5, // random people? 1 => 1, // Admin 2 => 5, 3 => 5, 4 => 5, 5 => 5, 6 => 5, 7 => 5, 8 => 5, 9 => 1, 10 => 5, 11 => 7, // VIP 12 => 6, // Adult 13 => 2, // Banned 14 => 5, 15 => 5, 16 => 5, 17 => 5 );
Ok, you see what I’ve done here? I’ve linked my SMF usergroup database id’s => EE usergroup database id’s. Pretty simple.
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
Go to SMF admin and make a note of the forum ids.
Edit the section in mcp.smf_import.php, around line 249:
$smf_ee_forums_link = array( 2 => 2, // Generelt 5 => 3, // Offtopic 7 => 4, 3 => 5, 4 => 2, 34 => 3, 9 => 2 );
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
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 firstname.lastname@example.org