SMF Import to bbPress
Introduce Forum Importer template for use with importing from SMF v2.0.x(Tested on v2.0.4)
http://codex.bbpress.org/import-forums/ & http://codex.bbpress.org/import-forums/smf
Working: Forums, Topics, Replies, Users & User Passwords
Partial: Custom BBCode for Topic & Reply Content
Not Working Yet: Categories
Attached to bbPress Trac Ticket #2380 is the 1st pass patch for SMF importing into bbPress.
To test the importer download the latest patch from the link above and copy/ftp the file into the /includes/admin/converters/ folder of your bbPress plugin.
I hope to get the remaining outstanding items done ASAP.
(User passwords will be a little trickier and will take a bit more time)
Any feedback and/or testing that you can provide will help me out tremendously.
Thanks for putting so much work into this, Stephen!
I’m really hoping to move everything from SMF to bbPress soon with the launch of a new WordPress site. Let me know how I can help, whether it be testing or anything else. Eagerly awaiting for the rest of the forum aspects to work in your import 🙂
With lots of appreciation,
I have SMF version 1.1.16 and am very curious to see how far you get and if it could then work for my version. Forum has lots of users and posts and it would be a shame to lose it all when moving over. Would like to see if it is at all possible to get this working.
Been giving this a try today and yeah there seems to be a problem with importing replies (which we know is not working yet). So to help out the OP I give an example of replies not importing. For instance, this is the total number of SMF messages on SMF database I wish to convert to BBPress:
mysql> select count(*) from smf_messages; +----------+ | count(*) | +----------+ | 2663 | +----------+ 1 row in set (0.00 sec)
Running the importer it seems to get stuck and stops importing:
mysql> select count(*) from wp_posts where post_type = "reply"; +----------+ | count(*) | +----------+ | 2252 | +----------+ 1 row in set (0.00 sec)
I am doing this on my own machine and looking at the apache logs I don’t see any errors related to the import. I also checked if there was a query stuck so I checked the process list and it was empty.
Going to debug the relevant scripts and see what I can find.
Hmmm something odd going on and I beginning to think it is to do with the number rows being processed for the replies. Running a test where I have set processing of 100 rows at a time it is showing in the status box as the following:
Converting replies (1500 - 1599)
Looking at the number of wp_posts where the post_type is equal to reply it shows 1652:
mysql> select count(*) from wp_posts where post_type = "reply"; +----------+ | count(*) | +----------+ | 1652 | +----------+ 1 row in set (0.00 sec)
I was checking the processlist whilst the import was running and the inserts just completely stopped with no errors.
I have updated the SMF Importer and you can download the latest again via the same links in my original post above.
- Forum parent hierarchy
- Imported Replies now import correctly
- User Display Name
- User Passwords
- Custom BBCode for Topic & Reply Content
NOTE: If you are importing ‘users’ during the import you will see multiple instances of the following two error messages:-
- Notice: Undefined variable: user_pass in /home/webhost/public_html/wp-includes/user.php on line 1305
- Notice: Undefined index: salt in /home/webhost/public_html/wp-content/plugins/bbpress/includes/admin/converters/SMF.php on line 566
These can both be ignored and only relates to the current non-working state of converting user passwords. If you need to login (or users login) they will just need to reset their WordPress password to be able to login.
@ricov4 Thanks, to help out if you can download the importer and setup a test environment to see how well it works that would be great.
@koawinter I have not tried SMF 1.1.16 and only downloaded the latest version of SMF. Are you able to update your SMF to v2.0.4? You could also try the importer and see if it does or does not work and we can go from there.
@NeilJ Thanks a bunch for testing it out… The previous versions of the counts would have been off as the original reply query was adding the original topic as its own reply, I have now fixed this and from my testing the counts are now correct for topics and replies.
As far as I can tell it is now only the user passwords and some custom regex strings to fix some converted BBCode and ‘Smilies’ and we will have a perfect SMF importer 🙂
Now having an issue where Apache on Windows 7 appears to crash and the conversion process stops when processing the replies with latest script. I’ll need to get a SS of the dialogs that appear which I will attach when I get the chance. It stops/crashes at around 1370 replies. Funny thing is apache and all the other services such as mysql etc. are still running.
Also noticed that we still seem to have the issue where the count is out by the same amount we set to process i.e. it says we are processing 100 – 200 rows when in fact we are processing 200 – 300. This goes for both topics and replies.
Going to run the previous script to see if this causes the same issue.
Yeah there is something up with Apache. Reverted to the old script and I am getting the same thing happening:
I’ll have a look and see what is causing it because it wasn’t happening yesterday.
Quick update: I decided to do the import on an actual dev server rather than on my local machine and it completed. It did the conversion a lot faster than running locally. It does, however, look like it has not converted over the categories and I am not confident that all of the topics have converted either. If am not too hungover tomorrow I will look into it more 🙂
Categories are not converted yet, I need to come up with some uber SQL statement to get these imported, I just took a quick look and drew a blank 😉
The rest of the forum hierarchy is fully imported though so you can just recreate the categories and then assign the remaining forums to these categories (typically not there are not many categories on forums so it should be a quick and easy workaround.
Yeah I am looking at how to import them myself. I was trying the following just to even get the categories into the database but it does nothing:
$this->field_map = array( 'from_tablename' => 'categories', 'from_fieldname' => 'id_cat', 'to_type' => 'category', 'to_fieldname' => '_bbp_forum_type' );
Not that the forum I am importing has a lot of categories but it would be nice if we could import these as well.
Sweet, I tried to make an importer based on the example and the phpbb but I couldn’t make it work, thanks a lot for the effort, I’m going to try it right now…
OK, so in my PC it was incredibly slow so I made a test SMF and deleted a ton of users, topics and replies and left about 7000 replies, 600 topics and 800 users, uploaded to a VPS and the conversion was really fast.
As far as I can tell the import went well, seeing the numbers I noticed a few topics/replies missing but I’m not sure if it’s that they were lost or the SMF statistics are wrong.
Anyway I’ll proceed to test with the full database to see how it goes.
Cool… After the import you must run the Repair Tools to get everything recounted…
I did run the repair tools.
Right now my import is going pretty well, 7,554 users, 40 Forums, 3,146 Topics, and 33,912 replies and counting.
Nice… The last ‘big’ import I did I was only missing ~10 topics or replies in total from ~40,000 imported, though it should be zero missed 😉 … If you find you are getting a high rate of topics or replies not being imported we can take a closer look.
First of all thanks for working on this great importer for bbPress 🙂 .
But I have one question:
When do you think the final version is ready (or when is password support ready)?
And an idea:
Maybe BuddyPress integration, for example: SMF Avatars to BuddyPress / bbPress avatars? And the custom fields from SMF to the BuddyPress profile?
Sorry for my bad English 🙂 (powered by Google Translate) and thanks to all the people who are working on this.
The final version should be ready for bbPress 2.5 in ~8 weeks (10/29/13 14:00:00)
I have not started on the passwords as these are hard and I have to do them for most of the new importers so I will get started on these next week I hope.
We are importing Email, URL, AIM & Yahoo into the default WordPress user profile and importing SMF’s ICQ, MSN, Signature, Avatar (link only), Location & Personal Text values and storing them in WordPress
wp_usermetatable so this can be later imported/manipulated into any custom WordPress profile plugin like BuddyPress, this is not automated in any way though.
Wishing something like this for years. Done search, but it was 6 years ago solution and not relevant anymore.
I even try myself but yet it’s too hard for me.
Owning a big forum of 8K user, 14K topics, 400K posts. SMF wasn’t suit me anymore since I used WordPress (my mainpage is wordpress, forum SMF). I’m intend to do something like WordPress + BBpress + Buddypress 😀
Im looking forward for this. 🙂
I had basically finished writing a converter template for smf 1.1.8 when I came across your post and your script. Good news is it looks like I got pretty close.
I would like to understand better what the authenticate_pass function is supposed to do. If it is just supposed to return true if the current user’s password matches the old smf hashed password then it seems that I should be able to use a function similar to ssi_checkPassword that was included in the SMF ssi.php script, assuming that the sha1 function is available.
Is there something more complicated that I am missing?
I realize that due to SMF licensing issues I would not be able to distribute the code I write for myself based on the ssi.php code.
By the way, shouldn’t this:
// User password verify class (Stored in usermeta for verifying password) $this->field_map = array( 'to_type' => 'members', 'to_fieldname' => '_bbp_class', 'default' => 'SMF' ); be this instead:
// User password verify class (Stored in usermeta for verifying password)
$this->field_map = array(
‘to_type’ => ‘user’,
‘to_fieldname’ => ‘_bbp_class’,
‘default’ => ‘SMF’
I have started the import using my modified version of the smf 2.xx converter file (I’m on smf 1.1.8)
The converter has been just sitting there saying “starting” for several minutes.
There isn’t that much data to go through because I pruned old messages and inactive members.
If there were some sort of error, would the importer report it?
One thing that is different is that I included the prefix in the importer file itself (like smf_boards rather than boards) and left the prefix field on the importer empty.
well, I turned on wp debug and found a simple syntax error in my file that was causing all / most of the problem.
I had included an authentication function that I think might have worked but had backed it out thinking it might have been causing the problem.
For anyone else thinking about using any of the converters, I would strongly recommend that you set WP_DEBUG to true in wp-config.php first.
Thanks for looking at this I uploaded a new version with the fix above for the ‘to_type’ you mentioned above.
I have not started with the passwords as of yet, this is next weeks job to look at all the importers passwords sections and begin writing custom callbacks for all of them. With my limited PHP skills this is going to be a challenge indeed. I will be calling heavily on the code found in the phpBB importer to base the code on and then changing any calculating/algorithms as needed.
If you beat me to it, I could live with that 😉
- The topic ‘SMF Import to bbPress’ is closed to new replies.