• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
  • This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

SMF 2 Importer

Robbo

Well-known member
#1
So I decided to change over to XenForo for a project I am involved in and was using SMF 2 for. I have worked with SMF 2 for several years now and figured I may as well do it right and write an importer.

So here is the incomplete importer which I will finish when I get free time or need it again...

TODO
- import polls
- import moderators
- import permissions per board
- other small settings here and there
- lots of other stuff that I can't think of, it is far from done

Importing polls isn't in yet as I never needed it, same with moderators and some other features it is missing. I have also barely tested it so be careful! I am not at fault if your server dies a horrible death.

I am not going to give support here however if you find a bug I'll try and find time to fix it.

User merging isn't supported and I don't plan to support it. This is designed to be used on a fresh install of XenForo. If there are any users that 'collide' then it will fail.

Installing
Upload the attached file and then install the addon by going to admin -> install addon and running SMF2Importer.xml. Go into tools -> import external data and see how you go from there.

No promises but I hope it works for you.
I also don't take into account charsets as of yet. Basically I had to take a heap of shortcuts to get what I needed done. I will hopefully finish it one day if there is any demand for it.
 

Attachments

#3
Nice, finally a importer. However when creating a template I get a error when I try ti save it.

"The following templates contained errors and were not saved: import_smf2_config: 1) Line 3: Unknown tag: form"
 

Robbo

Well-known member
#4
This is an admin template. You have to put your forum into debug mode and go to developement -> admin templates.
 
#6
I guess it doesn't work for me as I am getting this when trying to import:

Code:
Server Error

unserialize() [function.unserialize]: Error at offset 0 of 60 bytes

XenForo_Application::handlePhpError() in XenForo/Importer/SMF2.php at line 34
XenForo_Importer_SMF2->configure() in XenForo/ControllerAdmin/Import.php at line 56
XenForo_ControllerAdmin_Import->actionConfig() in XenForo/FrontController.php at line 303
XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
XenForo_FrontController->run() in /home/********/public_html/dev/test/upload/admin.php at line 13
This is from old RC3 database, perhaps upgrading to RC4 might work... but I am getting the feeling it will throw the same error.
 

Robbo

Well-known member
#9
I guess it doesn't work for me as I am getting this when trying to import:

Code:
Server Error

unserialize() [function.unserialize]: Error at offset 0 of 60 bytes

XenForo_Application::handlePhpError() in XenForo/Importer/SMF2.php at line 34
XenForo_Importer_SMF2->configure() in XenForo/ControllerAdmin/Import.php at line 56
XenForo_ControllerAdmin_Import->actionConfig() in XenForo/FrontController.php at line 303
XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
XenForo_FrontController->run() in /home/********/public_html/dev/test/upload/admin.php at line 13
This is from old RC3 database, perhaps upgrading to RC4 might work... but I am getting the feeling it will throw the same error.
I have a theory that SMF only serializes it when there is more then one attachment path. Will test it when I get a chance. The more you annoy me on here the more likely I will get it done.
 

Robbo

Well-known member
#11
I know your name but don't actually know who you are heh. I'm also in a state of drunkness and tiredness so things that are obvious... well aren't so obvious atm.
 

Robbo

Well-known member
#13
Yeah I am pretty sure what I am getting from the database is incorrect and only right if you use more then one attachment path. I'll look into it soon.

Also I did all my testing etc on an RC3 board and am assuming it works with RC4 :p
 

Robbo

Well-known member
#14
Ok, I have updated the database to RC4 and get the same error so it might be a issue with the attachment path you mentioned.
Ok since I haven't had time to setup a new enviroment for testing (my last one has gone as a live site heh) can you try something to see if my theory is correct and allow you to get past your error?

Go into your SMF attachment settings and configure a second attachment path. I think that SMF stores one attachment path in the database as a string and then if anymore are added it creates a serialized array. Or something similar.
 

Robbo

Well-known member
#15
Also I have discovered a couple things that haven't imported properly which I will try get fixed in the next release. I really need to setup a bug tracker for this since there is bound to be a lot. Another thought, I should create a bug tracker on the XF platform.
 
#17
Ok since I haven't had time to setup a new enviroment for testing (my last one has gone as a live site heh) can you try something to see if my theory is correct and allow you to get past your error?

Go into your SMF attachment settings and configure a second attachment path. I think that SMF stores one attachment path in the database as a string and then if anymore are added it creates a serialized array. Or something similar.
Added another path but it throwing the same error.
 

Robbo

Well-known member
#18
Didn't expect to see you here Robbo!

Anyhow, thanks for the importer. I'll be using it.
Lol I go to where my life is made easy. My life is made easy by XF code and SMF is progressing far too slow and stuck in the past.
Added another path but it throwing the same error.
Damn. Will try get some time to look at it soon. Was going to today but it turns out I'm sick lol.
 
F

Floris

Guest
#20
I've followed you on irc.xenfans.com in #chat as to making the smf2 importer, and I am happy to see it's release here and how far you've come. Very awesome stuff.