SMF to XenForo

Status
Not open for further replies.

qureshi007

New member
Dear sir I have a website where I am using SMF forum but now I want to change smf and use xenforo for forum but I have a problem that I have my previous posts on smf whom I do to want to waste you can see my old data and posts at my site http://www.achisite.com/ so is there any method available for migration of smf forum to xenforo and is there any discount coupon available ?
 
Doing some reading via Google (all older posts from 2007'ish) it looks like it is hit & miss. Didn't spend a lot of time researching it as I figure someone who has vB would know or the research could be done by those needing to know.

@Tracy Perry Yeah I've been researching for some time now with various options and versions multi steps but have not found one that didn't require hours or weeks of cleanup. If I had just one forum it would still be a time consumer but I have many and that makes needing an Xenforo supported converter from SMF to XF a must have.
 
Were yours in the avatar folder? Mine were and migration didn't work for them.

I think the "problem" for you could be that you moved your Avatars. This is mainly done to preserve CPU-load. We do not have such high loads so I have not moved them. Think the migration tool assumes that the avatars are loaded as "standard"

Please see this topic for an explanation of how avatars are handled in SMF

http://www.simplemachines.org/community/index.php?topic=145101.msg924564#msg924564
 
So , my "final" ( I hope :) ) question. I have solved most of the problems directly updating the database. My major concern is 301 redirects. The background is that we have implemented Pretty URLs which rewrites the URL in SMF. They way it does it is that it do not add any topic number. Also, looking on the Swedish Xenforo sites I got referenced it seems like the URL uses the Swedish characters åäö.

As an example a topic, number 2243 would have the following URLs

SMF with Pretty URL: www.mysite.com/amne/rott-for-500-kr/
phpbb: www.mysite.com/viewtopic.php?f=8&t=2243
Xenforo: www.mysite.com/threads/rött-för-500-kr.2243/

The key is to use the topic number as the usage of local character for Xenforo URLs makes it virtually impossible to know how it will be constructed. What I do have is a table in mysql which links the topic number to the Pretty URL which basically would list (for the above example

Topic ID Pretty URL
2243 rott-for-500-kr

Would it be possible to use this table and build any logic in php or similar. We are talking about 3000 topics. I'm not in any way a programmer, hence my question.

Thx in advance for any help

PS. I'm planning to test all steps and will document exactly how I did a potential migration. Will post that here if we move and if there are interest for this type of experiences.
 
Last edited:
So , my "final" ( I hope :) ) question. I have solved most of the problems directly updating the database. My major concern is 301 redirects. The background is that we have implemented Pretty URLs which rewrites the URL in SMF. They way it does it is that it do not add any topic number. Also, looking on the Swedish Xenforo sites I got referenced it seems like the URL uses the Swedish characters åäö.

As an example a topic, number 2243 would have the following URLs

SMF with Pretty URL: www.mysite.com/amne/rott-for-500-kr/
phpbb: www.mysite.com/viewtopic.php?f=8&t=2243
Xenforo: www.mysite.com/threads/rött-för-500-kr.2243/

The key is to use the topic number as the usage of local character for Xenforo URLs makes it virtually impossible to know how it will be constructed. What I do have is a table in mysql which links the topic number to the Pretty URL which basically would list (for the above example

Topic ID Pretty URL
2243 rott-for-500-kr

Would it be possible to use this table and build any logic in php or similar. We are talking about 3000 topics. I'm not in any way a programmer, hence my question.

Thx in advance for any help

PS. I'm planning to test all steps and will document exactly how I did a potential migration. Will post that here if we move and if there are interest for this type of experiences.

It is possible using a method similar to this:

http://xenforo.com/community/threads/vbseo-member-profile-redirect-to-xenforo-profile.42653/

A PHP script is needed to query the table to map the slug to the id. I can help with this if you need.
 
It is possible using a method similar to this:

http://xenforo.com/community/threads/vbseo-member-profile-redirect-to-xenforo-profile.42653/

A PHP script is needed to query the table to map the slug to the id. I can help with this if you need.

Thx Jake, it seems to do what I think needs to be done. There is one other thing I picked up and that is the fact that page numbering will change. As we have a couple of VERY long threads that are 30 posts per page vs xenforo that I think use 20, some clever logic needs to be in place. Seen some discussions on it.

My plan is now to purchase Xenforo, start some test migrations and implement any changes. Any help here will be highly appreciated. Thanks
 
I purchased Xenforo earlier today and have now moved my SMF forum to a first test installation on Xenforo. Below is the steps I followed. Perhaps it will help someone else that is planning the same move. If you spot any errors let me know as stated I'm still only in the test phase

Moving from SMF 2.04 to Xenforo 1.2.2 via phpBB 3.0.11

Preparation.

phpBB
  • Download latest version of phpBB from here
  • Download SMF to phpBB converter from here.
  • Instructions on how to make installation of converter and discussions on the actual migration here:
  • Update functions_smf20.php to fix quote error that occurs during migration. Code and explanation here
I made all the updates before I uploaded the files to the server

SMF
  • Make a backup of files and database
  • Clean up your site. Remove users (I had some spammers) and archive old threads
  • Print reports (under administration) for groups and users rights. This will help when restoring user and group security rights in Xenforo

Migration
  • Backup SMF files and database
  • Put the SMF forum in maintenance mode

Installation of phpBB
  • Create new database instance in MySQL
  • Upload phpBB to a subdirectory (I used phpBB) If you did not make the updates for quote and converter this needs to be done now.
  • Install phpBB following the instructions (point web browser to http://www.mydomain.com/phpbb/install/index.php )

Migration SMF to phpBB
  • Run the conversation (separate tab). For this you need to supply the database name, pw and location. Also you need to add the directory for attachements and avatars. To get to the root directory you need ../ in front of the link. My SMF installation is installed in the root directory and the link to attachments is ..//attachments
  • Delete the phpBB installation directory

Problems with phpBB converter
  • Forum permissions will not be imported correctly. I decided to fix than in Xenforo.
  • If you have users which member name and real name are different only the real name will be migrated as the new login name. This problems and a possible solution is described here As we only have a few members with this problem we will only inform them.
  • For some reason the converter used HTML to create spaced in a few posts. I have no idea why and wrote simple SQL to update that directly in the database.
MySQL code

Code:
UPDATE mydbname.com.phpbb_posts
SET mydbname_com.phpbb_posts.post_text
= REPLACE (mydbname_com.phpbb_posts.post_text ,' ',' ')
WHERE mydbname_com.phpbb_posts.post_text like ' ;%';


Install Xenforo


First there is a choice if you want to put Xenforo in a subdirectory or not. During this testing phase I did so as the SMF forum is running from the root directory but when I make the final migration I will delete the SMF files and drop all tables in MySQL instead of creating a new database instance.
  • Upload the Xenforo files
  • Point the browser to http://www.mydomain.com/install/index.php
  • Run the installation as per the manual. Very straight forward and similar to the phpBB installation
  • After installation you will be sent to the admin CP. Note: if you are going to use another language than English, install that now and mark it as default. This will give the imported users the right language from the beginning.
  • Put Xenforo in maintenance mode
Import from phpBB
  • Run import of data. This is found under TOOLS. Select phpBB 3.0.
  • Mark “Retain imported content IDs” if you plan to use 301 redirects as this will give the same thread number as originally in SMF.
  • The import tool will need the name, server, userid and password for the MySQL instance created for phpBB.
  • Use the paths supplied for attachments and avatars but make sure you enter the subdirectory, in my case phpbb
The importer works in a simple step by step approach. Just press one button at the time.
I used the permission tool that are part of the importer. Much easier to use then the functions in the actual Xenforo which seems very complex and lacking a good overview.

At this stage you are done and have your forum moved to Xenforo. Now configuration etc probably need to take place. In my case I will start looking on the 301 redirect.

Overall, this is not as cumbersome as it sounds but a direct importer would be something for the Xenforo developers to consider. The SMF installed base is ripe for replacement and Xenforo is one of the strongest candidates for forums that want to take the next step.
 
Last edited:
Thx Jake, it seems to do what I think needs to be done. There is one other thing I picked up and that is the fact that page numbering will change. As we have a couple of VERY long threads that are 30 posts per page vs xenforo that I think use 20, some clever logic needs to be in place. Seen some discussions on it.

Change XenForo to match.

admin.php?options/list/messageOptions
 
If passwords don't work after a double import then it is possible to save them. It requires having access to all 3 databases to create an id map for the users. Then a query can be constructed to write the password information to the XF database. Then you need to create a custom auth class to properly read the password information.
I have problems with the passwords moving from SMF via PHPbb to Xenforo and ideally I do not want people to have to change them. It seems like if I sign on to phpBB after migration from SMF but before importing the users to Xenforo password will work, otherwise not.

How much work would do you think it would be to create a query and custom auth class
 
Last edited:
I have problems with the passwords moving from SMF via PHPbb to Xenforo and ideally I do not want people to have to change them. It seems like if I sign on to phpBB after migration from SMF but before importing the users to Xenforo password will work, otherwise not.

How much work would do you think it would be to create a query and custom auth class

If you give me access to all 3 databases, and give me FTP access to your server then I can do it for you. I also need a working username/password for SMF as a test case.
 
For others, this is how I did it...

I uploaded the attached file to the library/XenForo/Authentication directory.

Then I copied the smf_members table from the SMF database to the XenForo database.

Then I ran this query on the XenForo database:

Code:
UPDATE xf_user_authenticate AS ua, smf_members AS m
SET ua.data = BINARY
	CONCAT(
		CONCAT(
			CONCAT('a:3:{s:4:"hash";s:40:"', m.passwd),
			CONCAT('";s:4:"name";s:', LENGTH(LOWER(m.member_name)), ':"', LOWER(m.member_name))
		),
		'";s:8:"hashFunc";s:4:"sha1";}'
	),
ua.scheme_class = 'XenForo_Authentication_SMF'
WHERE ua.user_id = m.id_member
AND LENGTH(m.passwd) = 40;

Note that in the case of his import the user_ids were the same in both SMF and XF (WHERE ua.user_id = m.id_member). Otherwise a subquery would normally be necessary to do the id map.
 

Attachments

Jake

Thanks a lot, worked like a charm. With that out of our way we can focus on the content. I must say that support from the Xenforo team and the community widely surpassed that I experienced in SMF. Payed SW, of course, but that does not directly correlate to good support. So THANKS
 
Hey guys,
I've just finished my port, but I've forgot to run this code on the phpbb database:
Code:
UPDATE mydbname.com.phpbb_posts
SET mydbname_com.phpbb_posts.post_text
= REPLACE (mydbname_com.phpbb_posts.post_text ,' ',' ')
WHERE mydbname_com.phpbb_posts.post_text like ' ;%';

Is there a way to run it on the xenforo database?
 
First. I'm not a SQL-guru. So BACKUP :)

I had to change the same thing in Xenforo for conversations. Worked perfect. In both examples below change my_db_name to the name of your DB. It also assumes you used the standard xf_ when you installed Xenforo. And again BACKUP before you run this :). Probably everyone in this community are better than me on SQL

SQL for posted messages
Code:
UPDATE my_db_name.xf_post
SET my_db_name.xf_post.message
= REPLACE (my_db_name.xf_post.message ,' ',' ')
WHERE my_db_name.xf_post.message like '% %';

SQL for conversation messages
Code:
UPDATE my_db_name.xf_conversation_message
SET my_db_name.xf_conversation_message.message
= REPLACE (my_db_name.xf_conversation_message.message ,' ',' ')
WHERE my_db_name.xf_conversation_message.message like '% %';

EDIT: Updated SQL
 
Last edited:
Status
Not open for further replies.
Top Bottom