- Compatible XF Versions 1.x
- Additional Requirements
"Retain imported content IDs" during SMF import.
"Use Full Friendly URLs" should be enabled in XenForo.
"Include Content Title in URLs" might be enabled but It will give you an extra redirect. (personally I don't like Titles in URLs)
This script is designed for default SMF URLs. If you enabled "Search engine friendly URLs" in SMF, the redirection will not work with this script.
The reason I didn't use .htaccess or Nginx rewrites is because the redirects needed some simple math. This was not easily possible with .htaccess / nginx.
Replace your SMF index.php with this redirect script and edit the configuration part.
I'll assume you installed XenForo in a new directory. This will make things much easier!
If you are going to install SMF and XenForo in the same directory, you will need to do some extra redirects in .htaccess/nginx which filters the SMF requests and directs them to this script.
You should test this script before the real migration. Make sure everything works.
Just edit the first part of the script to suite your needs:
$redir_url = 'https://www.domain.com/smf'; // URL of your new forum, without trailing slash
$forums = 'forums'; // URL name of forums (only change this if you are using route filters)
$threads = 'threads'; // URL name of threads (only change this if you are using route filters)
$posts = 'posts'; // URL name of posts (only change this if you are using route filters)
$members = 'members'; // URL name members (only change this if you are using route filters)
$threads_count = 10; // Make sure the number of threads is the same for SMF and XenForo.
$mode = 0; // 0 = testing / 1 = temp redirect / 2 = perm redirect
First you should use mode = 0 to see what the redirect is doing, after that you can use mode = 1 to test the real thing. After that, if everything is fine, use mode = 2.