Simple Machines Community Forum

SMF Support => Converting to SMF => Topic started by: margarett on October 06, 2013, 05:09:45 PM

Title: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on October 06, 2013, 05:09:45 PM
Following some requests here, I tried to create a converter from XF. The attached file results of some trial-and-error around XF's database schema and the necessary equivalent in SMF.
Unfortunately I struggled too much with the "official" converters so I eventually gave up and started from scratch. I know that I've probably tried to reinvent the wheel but this way I know what I am doing, every step of the way.
Also, I'm not very good at design and present forms to fill and blablabla. So, there is no beautiful layout and some file edits are needed. Nothing too much, but it has to be done.

What the converter will convert:

How to use this converter:
1 - BACKUP
2 - Install SMF in a separate folder and in the same database as XF
3 - Download the attached "xf2smf.php" file to you computer and edit it with a decent editor (eg: Notepad++). The small edits that are needed are all localized in this part here:
(https://www.simplemachines.org/community/index.php?action=dlattach;topic=512266.0;attach=225037;image)
3.1 - You need to define the folder where XF is installed. By folder, I mean the server path where XF's installation is located. SMF's path is automatically discovered (because you will put the file there :P ). If you don't know it, please upload the attached "whats_the_path.php" file to XF's folder and run it via browser. It will tell you the path you should add.
3.2 - You need to adjust my "$max_queries" variable. This defines how many registers the converter tries to move at once. A low number takes a LOT of time, a large number will hammer your server and may cause it to become unresponsive.
3.3 - As my image above states, I didn't find a way to change XF's table prefix, so it shouldn't be necessary to change anything else. But, in case your prefix isn't "xf_" please edit the corresponding line
4 - Save. Load the file "xf2smf.php" to SMF's folder and launch it through your browser. The whole "thing" is a step-by-step operation and each step deals with each of the converted parts.
4.1 - You will notice, in the first screen, that the paths for SMF and XF (the first one is self-discovered, the second was set by you) are shown. Please check them ;)
(https://www.simplemachines.org/community/index.php?action=dlattach;topic=512266.0;attach=225039;image)
5 - When the conversion finishes, you should remove the file from your SMF folder. Go to your newly converted forum and recover your password. The converter does not (and probably will not) convert passwords so you need to follow the usual steps for password recovery. If you cannot email yourself a new password, use this trick from the wiki (http://wiki.simplemachines.org/smf/I_accidentally_lost_my_admin_account!_What_can_I_do):
QuoteResetting an admin users password

Use phpMyAdmin (or similar) to locate (within the "_members" table) the member whose password is to be reset. In the database field entitled "passwd", enter a new password using plain text.
Then, clear out (erase) any existing content in the database field entitled "password_salt".
The next time the member logs in (using the new password), SMF will automatically re-encrypt his credentials.
6 - Go to your ACP --> Maintenance --> Recount all forum totals and statistics. This will (obviously) fill your boards and topics totals.

That's it, for now. Please do test and let me know the outcome. If the converter throws a "database error" somewhere, it will be stored in the table "smf_log_errors" (it will probably be the last one). It is handy if you check that table and also attach your "xf2smf.php" in use.
Finally, be advised that this was developed and tested with a local installation of XAMPP, so I cannot tell the impact in a live and especially shared server. It shouldn't kill it, don't worry :P

License: Simplified BSD (BSD-2) (http://wiki.simplemachines.org/smf/Customization_Licenses#Simplified_BSD)

Code (Changelog) Select

Version 1.02 // 22-03-2016
! Fixed issue with trying to insert empty polls
! Changed license to Simplified BSD

Version 1.01 // 18-03-2014
================================================================================
! Fixed issue with empty "poster_name" or "poster_email"

Version 1.00 // 13-11-2013
================================================================================
+ Added import for polls
+ Added option to automate the converter (moving between steps automatically)

Version 0.14 // 26-10-2013
================================================================================
! Fixed possible issue with password not stored as initially expected

Version 0.13 // 26-10-2013
================================================================================
+ Added a license
+ Added import for user avatars

Version 0.12 // 21-10-2013
================================================================================
+ Added import for Post Attachments

Version 0.11 // 07-10-2013
================================================================================
+ Added import for PMs

Version 0.10 // 06-10-2013
================================================================================
+ First release

Legend:
--------------------------------------------------------------------------------
! Minor change or bugfix.
+ Feature addition or improvement.
- Feature or option removal.
Title: Re: [WIP] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on October 07, 2013, 07:00:38 PM
Updated: PMs are now converted :)
Title: Re: [WIP] XenForo 1.2 --> SMF 2.0.x
Post by: AllanD on October 09, 2013, 08:40:26 AM
Thank you Margerett I will try this out today sometime and post back here for you.
Title: Re: [WIP] XenForo 1.2 --> SMF 2.0.x
Post by: AllanD on October 09, 2013, 09:07:39 AM
Quick question and for some reason I can't remember how to define the root directory for the xenforo install.
Title: Re: [WIP] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on October 09, 2013, 09:16:26 AM
Ty for trying.

Edit the converter and edit the line:

$xf_dir = '';

If you are unsure of what the full path is, upload the attached file to XF's folder and run it through your browser. It will tell you the folder.
Title: Re: [WIP] XenForo 1.2 --> SMF 2.0.x
Post by: AllanD on October 09, 2013, 09:41:03 AM
ok got that sorted out here is the error I'm receiving

in the acp

http://xxxxx.com/forum/xf2smf.phpApply Filter: Only show the errors with the same messageDatabase Error: Table 'xxxx_smf.xf_user' doesn't existApply Filter: Only show the errors from this file File: /home/xxx/public_html/forum/xf2smf.php
Line: 71

and this is the error in the

Table 'xxxx_smf.xf_user' doesn't exist
File: /home/xxxxx/public_html/forum/xf2smf.php
Line: 71

If you need to know the xxxx i will pm you.
Title: Re: [WIP] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on October 09, 2013, 09:48:10 AM
Did you install both XF and SMF in the same DB (different prefixes)?
Is the prefix for XF's tables "xf_"?

That line is just a test to see if it finds both sets of tables (and I just tested both "members" tables).
So, the script cannot find the table "xf_user" in the database "xxxx_smf".
Title: Re: [WIP] XenForo 1.2 --> SMF 2.0.x
Post by: AllanD on October 09, 2013, 10:00:57 AM
oh they have to go into the sames Db, not on the same server?  Never done that so not sure how lol
also will that mess up the current live xenforo forum.
Title: Re: [WIP] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on October 09, 2013, 10:05:08 AM
It won't mess up, as long as you don't mix the table prefixes ;)

Using the default values in both forums, XF is "xf_" and SMF is "smf_". So it should be safe ;)
Just backup your XF DB for the sake of conscience, but it will be fine.
Title: Re: [WIP] XenForo 1.2 --> SMF 2.0.x
Post by: AllanD on October 09, 2013, 02:51:20 PM
Once I got this the set worked like a charm, no errors converting.
Title: Re: [WIP] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on October 09, 2013, 02:55:17 PM
Very nice to "hear" that, thanks a lot. ;D

Can you check if everything is in place, no missing boards, topics, PMs, etc? The conversion from "Conversations" from our "PM" was a bit tricky, I admit...

Post attachments are in the making ;)
Title: Re: [WIP] XenForo 1.2 --> SMF 2.0.x
Post by: AllanD on October 09, 2013, 03:16:14 PM
Everything is in order, Pm's, topics and boards all is great. Thank you so much for this.
Title: Re: [WIP] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on October 21, 2013, 10:00:27 PM
New update. The converter is now taking care of Post Attachments.
Title: Re: [WIP] XenForo 1.2 --> SMF 2.0.x
Post by: AllanD on October 22, 2013, 10:03:26 AM
Very nice, was looking for a like button :P
Title: Re: [WIP] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on October 25, 2013, 08:43:36 PM
New update: user avatars are now converted :)
Title: Re: [WIP] XenForo 1.2 --> SMF 2.0.x
Post by: matt1206 on October 30, 2013, 11:43:32 AM
I'm getting the following error on the members section when trying to convert:

This is the first step of the conversion. We are trying to convert Members


First, let's trash the actual contents of SMF members table....
Members cleared from SMF table. Next step, how many members are in XF "users" table? 20 users were found in XF.
Now retrieving members 1 to 10...

Notice: Undefined index: hash in /home/sffcouk/public_html/smf/xf2smf.php on line 210

Notice: Undefined index: hash in /home/sffcouk/public_html/smf/xf2smf.php on line 210

Notice: Undefined index: hash in /home/sffcouk/public_html/smf/xf2smf.php on line 210
An Error Has Occurred!

The database value you're trying to insert does not exist: passwd


Converting from XF1.2.2

Thanks,
Matt
Title: Re: [WIP] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on October 30, 2013, 11:56:47 AM
Hu? :o Let's hope that the database schema wasn't changed (I used 1.2.0). Can you please edit the file, find:
foreach ($members as $key => $value)
{
$temp_passwd = unserialize($value['passwd']);

Add after:
echo '<pre>';
print_r ($temp_passwd);
echo '</pre>';


And repeat?
Title: Re: [WIP] XenForo 1.2 --> SMF 2.0.x
Post by: matt1206 on October 30, 2013, 11:59:26 AM
Sure:

First, let's trash the actual contents of SMF members table....
Members cleared from SMF table. Next step, how many members are in XF "users" table? 20 users were found in XF.
Now retrieving members 1 to 10...
Array
(
    [hash] =>
)
Array
(
    [hash] =>
)
Array
(
)

Notice: Undefined index: hash in /home/sffcouk/public_html/smf/xf2smf.php on line 213
Array
(
   
)
Array
(
)

Notice: Undefined index: hash in /home/sffcouk/public_html/smf/xf2smf.php on line 213
Array
(
    [hash] =>
)
Array
(
    [hash] =>
)
Array
(
)

Notice: Undefined index: hash in /home/sffcouk/public_html/smf/xf2smf.php on line 213
Array
(
    [hash] =>
)
Array
(
    [hash] =>
)
An Error Has Occurred!

The database value you're trying to insert does not exist: passwd
Title: Re: [WIP] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on October 30, 2013, 12:03:48 PM
Sorry, edited your post to remove the hash. Just in case ;)
Anyway, it was OK, there is no reason for the undefinedindex, unless it's some PHP version difference...
Can you please attach your current xf2smf.php here?
Title: Re: [WIP] XenForo 1.2 --> SMF 2.0.x
Post by: matt1206 on October 30, 2013, 12:05:42 PM
Thanks. Should be attached.
Title: Re: [WIP] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on October 30, 2013, 12:21:52 PM
Please re-download the zip file above. I imagine XF has more ways to store passwords that what I could test initially :P
Title: Re: [WIP] XenForo 1.2 --> SMF 2.0.x
Post by: matt1206 on October 30, 2013, 12:29:16 PM
Quote from: margarett on October 30, 2013, 12:21:52 PM
Please re-download the zip file above. I imagine XF has more ways to store passwords that what I could test initially :P
Brill, thanks. That's now getting to Stage 8 (Polls). It's printing out the array of polls, and then stopping there. Looking in the code, the section for adding the polls is commented out. Is that the case?
Title: Re: [WIP] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on October 30, 2013, 01:03:22 PM
Err, sorry :P I've uploaded a work-in-process file, as the polls are not yet completed. Please re-download (just deleted that incomplete part) or ignore that, it didn't change anything in the database regarding polls.

You can go to your new SMF, recover your passwords and recount totals ;)
Title: Re: [WIP] XenForo 1.2 --> SMF 2.0.x
Post by: matt1206 on October 30, 2013, 01:20:09 PM
Quote from: margarett on October 30, 2013, 01:03:22 PM
Err, sorry :P I've uploaded a work-in-process file, as the polls are not yet completed. Please re-download (just deleted that incomplete part) or ignore that, it didn't change anything in the database regarding polls.

You can go to your new SMF, recover your passwords and recount totals ;)
Thanks again for this. All working and up and running on SMF  ;)
Title: Re: [WIP] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on October 30, 2013, 01:21:19 PM
Thank you for testing ;)
I'll be finishing polls shortly (I hope :P )
Title: Re: [WIP] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on November 13, 2013, 07:49:35 AM
Update: Polls are now converted 8)
I called this "V1.00" and it is the first "full" version. I will not develop it any further as it is now converting all the relevant content.
I am, however, available for the necessary support and bug-fixing (oh, it will be needed :P )
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: AllanD on November 13, 2013, 07:51:49 AM
Great work Margarett, this is the first xenforo converter I have see for non-paid software.
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: AllanD on December 25, 2013, 11:21:22 AM
Just tried this again on another forum and go this error on stage 7

Warning: dir(public_html/data/avatars/l) [function.dir]: failed to open dir: No such file or directory in /home/xxxt/public_html/forum/xf2smf.php on line 2071

Fatal error: Call to a member function read() on a non-object in /home/xxxx/public_html/forum/xf2smf.php on line 2073
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: AllanD on December 25, 2013, 11:28:14 AM
I did some looking around inside the data/avatars foder and there are 3 folders in the avatar l,m.s and then a subfolder 0 in each of them that actually contains the avatars. Hope that helps.
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on December 25, 2013, 05:55:05 PM
Yup, that's really how it works. The avatars are obtained from the sub-folders inside folder "l" And the functions I used have issues dealing with a folder named "0", so there is also a rename operation included. I'm not on the computer right now, but I'll look into it ASAP.
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: AllanD on December 25, 2013, 06:16:42 PM
Ok great, everything else is great. I got the forum up and running besides the avatars and polls which I think is step 8.
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on December 25, 2013, 06:53:15 PM
Just curious, did you successfully convert post attachments in the previous step?

I'm under the impression that you might have set an incorrect path for XF.
Your SMF path is: /home/xxxx/public_html/forum
But the error you are getting looks for XF files in public_html/data/avatars/l.
See the difference? No /home/xxxx/public_html...
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: AllanD on December 25, 2013, 07:04:42 PM
Everything converted great besides the avatars, the topics, posts and members went fine.
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on December 26, 2013, 05:33:01 AM
Humm... I can't reproduce that :(

What did you set in this bit:

//YOU HAVE TO DEFINE THIS
$xf_dir = '';

?
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: AllanD on December 26, 2013, 07:15:48 AM
I just have public_html in there since the xenforo is in the root folder.
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on December 26, 2013, 08:12:57 AM
Like this:

//YOU HAVE TO DEFINE THIS
$xf_dir = 'public_html';

Or like this:

//YOU HAVE TO DEFINE THIS
$xf_dir = '/home/xxxx/public_html';

?
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: AllanD on December 26, 2013, 09:28:31 AM
I have it like the top one.

//YOU HAVE TO DEFINE THIS
$xf_dir = 'public_html';
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on December 26, 2013, 09:39:11 AM
Try with the other one ;)
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: AllanD on December 26, 2013, 09:45:45 AM
OK I wil, out work right so will be later.
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: badabugs on March 18, 2014, 01:16:30 PM
Hi there;

I'm trying to convert my Xf forum to SMF with your plugin and i get this error ... but it happens after 2500 posts ...

Best regards

First, let's trash the actual contents of SMF "topics" and "messages" tables....
Posts and topics cleared from SMF tables. Next step, count what's there to move?? 525 topics and 4116 posts were found in XF.
Now retrieving topics 1 to 50...
Now retrieving topics 51 to 100...
Now retrieving topics 101 to 150...
Now retrieving topics 151 to 200...
Now retrieving topics 201 to 250...
Now retrieving topics 251 to 300...
Now retrieving topics 301 to 350...
Now retrieving topics 351 to 400...
Now retrieving topics 401 to 450...
Now retrieving topics 451 to 500...
Now retrieving topics 501 to 525...
Now retrieving posts 1 to 50...
Now retrieving posts 51 to 100...
Now retrieving posts 101 to 150...
Now retrieving posts 151 to 200...
Now retrieving posts 201 to 250...
Now retrieving posts 251 to 300...
Now retrieving posts 301 to 350...
Now retrieving posts 351 to 400...
Now retrieving posts 401 to 450...
Now retrieving posts 451 to 500...
Now retrieving posts 501 to 550...
Now retrieving posts 551 to 600...
Now retrieving posts 601 to 650...
Now retrieving posts 651 to 700...
Now retrieving posts 701 to 750...
Now retrieving posts 751 to 800...
Now retrieving posts 801 to 850...
Now retrieving posts 851 to 900...
Now retrieving posts 901 to 950...
Now retrieving posts 951 to 1000...
Now retrieving posts 1001 to 1050...
Now retrieving posts 1051 to 1100...
Now retrieving posts 1101 to 1150...
Now retrieving posts 1151 to 1200...
Now retrieving posts 1201 to 1250...
Now retrieving posts 1251 to 1300...
Now retrieving posts 1301 to 1350...
Now retrieving posts 1351 to 1400...
Now retrieving posts 1401 to 1450...
Now retrieving posts 1451 to 1500...
Now retrieving posts 1501 to 1550...
Now retrieving posts 1551 to 1600...
Now retrieving posts 1601 to 1650...
Now retrieving posts 1651 to 1700...
Now retrieving posts 1701 to 1750...
Now retrieving posts 1751 to 1800...
Now retrieving posts 1801 to 1850...
Now retrieving posts 1851 to 1900...
Now retrieving posts 1901 to 1950...
Now retrieving posts 1951 to 2000...
Now retrieving posts 2001 to 2050...
Now retrieving posts 2051 to 2100...
Now retrieving posts 2101 to 2150...
Now retrieving posts 2151 to 2200...
Now retrieving posts 2201 to 2250...
Now retrieving posts 2251 to 2300...
Now retrieving posts 2301 to 2350...
Now retrieving posts 2351 to 2400...
An Error Has Occurred!
The database value you're trying to insert does not exist: poster_name



[Edit] I'm doing the conversion in local with wampserver. XF 1.3 and SMF 2.0.7
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on March 18, 2014, 01:45:06 PM
Hi and welcome to SMF ;)

Don't you just love converters? :P I assume you have no posts with IDs between 2351 and 2400 because I can't reproduce that in my test board... Can you try to increase the number of $max_queries?

(note to self: this needs to be verified and fixed, of course)
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: badabugs on March 18, 2014, 02:31:41 PM
Thanks for your help Margarett and i love converters. Perhaps it will be the first time that i'll have to use only one converter  !

So i've increase the $max_queries (trying many value 100 - 200) and it's the same. It stops at the same post ... but i don't see anything special in the next post ... I've tried to increase value in php.ini but nothing (With the same settings, i've convert a forum with more than 100.000 posts without any issues but it was from phpbb to xf).
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on March 18, 2014, 03:08:12 PM
Actually I think I was reading it wrong, that shouldn't be the issue.

I think that you might have some posts without username (deleted members, maybe?)
On the converter, you can find this:

// echo '<pre>';
// print_r ($data_array);
// echo '</pre>';

$smcFunc['db_insert']('insert',
$prefix_smf . 'messages',
array(

Can you uncomment the 3 first lines and repeat?
Please note that this will dump a big amount of information. Then please let me check the result of the last few operation(s).
Thanks
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: badabugs on March 18, 2014, 03:21:15 PM
Quote from: margarett on March 18, 2014, 03:08:12 PM
Actually I think I was reading it wrong, that shouldn't be the issue.

I think that you might have some posts without username (deleted members, maybe?)
On the converter, you can find this:

[b][color=red]// echo '<pre>';
// print_r ($data_array);
// echo '</pre>';[/color][/b]

$smcFunc['db_insert']('insert',
$prefix_smf . 'messages',
array(

Can you uncomment the 3 first lines and repeat?
Please note that this will dump a big amount of information. Then please let me check the result of the last few operation(s).
Thanks

There are still uncomment ... (The red ones)
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on March 18, 2014, 03:22:34 PM
No, I mean, uncomment them. Like:
echo '<pre>';
print_r ($data_array);
echo '</pre>';

$smcFunc['db_insert']('insert',
$prefix_smf . 'messages',
array(

And try again.
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: badabugs on March 18, 2014, 03:39:56 PM
See attached file

marg edit: attachment removed for privacy ;)
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: badabugs on March 18, 2014, 04:22:42 PM
Hum ... if you open the file in browser there're problems with some links ... the closed code </a> seems to have disappear (during a migration, i think)... Should it be the problem ?

[EDIT]Links repaired, same issue  :-\
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on March 18, 2014, 04:55:16 PM
Yeah, I think this is the issue:

    [197] => Array
        (
            [id_msg] => 6489
            [id_topic] => 6489
            [id_board] => _removed_
            [poster_time] => _removed_
            [id_member] => 236
            [id_msg_modified] => _removed_
            [subject] => _removed_
            [poster_name] =>
            [poster_email] =>
            [poster_ip] =>
            [smileys_enabled] => 1
            [modified_time] => 0
            [modified_name] =>
            [body] => _removed_
            [icon] => xx
            [approved] => 1
        )

This has no user/email and those are mandatory fields in SMF ;) I'll update the converter to add some dummy values in those fields if they are empty.
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on March 18, 2014, 05:17:31 PM
Should be fixed ;)
Please re-download and try again.
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: badabugs on March 19, 2014, 01:26:50 AM
it seems to work but i had an issue on the fifht step (iti seems to be a php one)

This is the fifth step of the conversion. We will now convert Conversations(XF)/PMs(SMF)

First, let's trash the actual contents of SMF "personal_messages" and "pm_recipents" tables....
PMs cleared from SMF tables. Next step, count what's there to move?? 467 PMs were found in XF.
Now retrieving messages 1 to 100...

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0
Now retrieving messages 101 to 200...
Now retrieving messages 201 to 300...
Now retrieving messages 301 to 400...

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0

( ! ) SCREAM: Error suppression ignored for
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\xf2smf.php on line 1054
Call Stack
# Time Memory Function Location
1 0.0018 797128 {main}( ) ..\xf2smf.php:0
Now retrieving messages 401 to 467...


Conversations seems to be have been imported ...
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on March 19, 2014, 02:52:43 AM
Did everything convert already? Welcome to SMF ;)
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: badabugs on March 19, 2014, 04:49:10 AM
It seems to be OK. Thanks Margarett. I just have to find a way to made custom BBCODE and restore my permissions.  ;)
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on March 19, 2014, 05:28:21 AM
Yeah, the permission is really something I can't handle, mostly due to my "non-experience" with XF.

What custom BBC are you using, that SMF doesn't know about?
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: badabugs on March 19, 2014, 06:00:17 AM
Yes, the permissions are really differents from xf to smf, but it should be great feature if you could add the groups in the converter (without permissions).

I've BBCODE for videos like [media="youtube"]dfdf1d22sd1[/media] or [media="dailymotion"]dfdf1d22sd1[/media] and [ATTACH=full][/ATTACH] for attached files that don't work.

I've tried aeva mods but it doesn't work.

For the attach bbcode, it's particular, attached files have a number who is incremented, it doesn't use the link of the file but this number. it shouldn't be easy to make it works without modify posts ...

Also, i've a small issue perhaps, you'll be able to help me : the WYSIWYG editor is missing. I've the default template and others : same issue.
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on March 19, 2014, 07:52:48 AM
I might be able to help you on the media BBC, but please open a new topic for it in Coding board. With some search and replace and one of the automatic embeder MODs that exist here, we might fix it for you ;)

The groups... Aren't they converted? :o
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: badabugs on March 19, 2014, 08:43:25 AM
Quote from: margarett on March 19, 2014, 07:52:48 AM

The groups... Aren't they converted? :o

They aren't ...  :)
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on March 19, 2014, 09:27:35 AM
I have to check. Thank you for using the converter and reporting issues ;)
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: badabugs on March 19, 2014, 09:44:16 AM
I can send you my SQL files if you want.

Another suggest : converting smilies ;)

Thanks for your help and your quick answers !
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on March 19, 2014, 09:47:54 AM
Quick answers: phone power ;D

I'm not sure if I can convert smileys, the original ones are probably copyrighted...
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: badabugs on March 19, 2014, 10:01:08 AM
Quote from: margarett on March 19, 2014, 09:47:54 AM
I'm not sure if I can convert smileys, the original ones are probably copyrighted...

It was mostly for custom ones that i add ;)
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: SaltedWeb on April 30, 2014, 06:28:58 PM
To far out of my ability, maybe someday day they will create a converter.
I really hate XF, never should have left.

Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: AllanD on April 30, 2014, 08:05:23 PM
If you are talking about converting to smf I will say this is very easy compared to some I have done. Biggest them to remember is to put SMF in to the same datebase as the Xenforo, then run the script.
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: SaltedWeb on April 30, 2014, 08:14:48 PM

Hi there, not sure if I even know how to do that :)
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on April 30, 2014, 08:20:35 PM
I'm not sure I understand your question, sorry...

Do you have XF? Do you wish to convert to SMF? Can't you do it? Need help? Having issues?

Sorry, we really need more to help you in whatever problem you're having...
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: SaltedWeb on April 30, 2014, 08:44:50 PM
Quote from: AllanD on April 30, 2014, 08:05:23 PM
If you are talking about converting to smf I will say this is very easy compared to some I have done. Biggest them to remember is to put SMF in to the same datebase as the Xenforo, then run the script.


Hi sorry , I have 1.25 Xenforo. Been using SMF along time and migrated the current SMF in 2/14 and I really hate XF .
The support is horrible for a paid product and XF is not even close to SMF productivity.  I am wanting to go back to SMF.
I have an active forum with 7000+ posts . I was intrigued in this topic. But seems way beyond what I can do.
" to put SMF in to the same datebase as the Xenforo, then run the script."
Made no sense to me I barely understand how Mysqls work. I am old school webmaster since 1996 used to HTML and Java, then along came PHP and MYsqls and I never caught up.  Had Smf back in 2005 and loved it then, reopened another two sites this year.
One is SMF and I have it working well. The other was one I converted and went DOH!
I would like to go back to SMF but no idea where to even start to take XF to SMF.






Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on April 30, 2014, 08:54:57 PM
1.25 is your XF  version?
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: SaltedWeb on April 30, 2014, 10:24:54 PM
1.2.5 . Left a period out ooops :-)
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on May 01, 2014, 05:26:57 PM
The database schema should be the same, so it should work.

You only need to install SMF in the same database as XF. Then run the converter
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: SaltedWeb on May 01, 2014, 06:53:44 PM
Quote from: margarett on May 01, 2014, 05:26:57 PM
The database schema should be the same, so it should work.
You only need to install SMF in the same database as XF. Then run the converter

The " should be " part is what worries me.
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: AllanD on May 01, 2014, 07:45:47 PM
Just take a backup of the database, before you do anything. This way you can always put it back.
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on May 01, 2014, 07:57:29 PM
And, like with any other converter, the original setup is untouched, which means there is no risk ;)
A backup is always nice to have, nevertheless. :P
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: AllanD on May 01, 2014, 08:02:44 PM
Quote from: margarett on May 01, 2014, 07:57:29 PM
And, like with any other converter, the original setup is untouched, which means there is no risk ;)
A backup is always nice to have, nevertheless. :P

I just thought about this and came back to post it :P
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: ashkir on May 08, 2014, 05:53:26 PM
I'm attempting to convert a very, very large forum. Members did fine. But, when it went to nodes:

step=2
Database Error: Duplicate entry '255' for key 'PRIMARY'


I checked the node ids we have no two copies of 255

Tried a few more times. Anyways,

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FgUUTwwN.png&hash=368ea5f4de2e03040f8b49abd9f008b6d1844505)

Any time it gets to 255 no matter what or if I change the node type it stops there. Is there a 255 limit?
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on May 08, 2014, 06:01:06 PM
That's a different problem. It's something SMF/MySQL related.

In step 2 we convert categories. In SMF, they are stored in smf_categories table and the column "id_cat" is a "tinyint", which means that it can only store values up to 255. Two or more of your categories have an ID larger that this and, when MySQL tries to add that ID to the database, it is limited to and written as 255. There lies your issue.

You need to ALTER the table "smf_categories" and make "id_cat" an "int" or "smallint" field instead of tinyint.
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: ashkir on May 08, 2014, 06:06:27 PM
Thanks. We have over 500 nodes =X
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: ashkir on May 08, 2014, 06:19:08 PM
I'm not entirely sure how to do the alter. But, in the backup of categories

CREATE TABLE IF NOT EXISTS `smf_categories` (
  `id_cat` smallint(4) unsigned NOT NULL AUTO_INCREMENT,
  `cat_order` smallint(4) NOT NULL DEFAULT '0',
  `name` varchar(255) NOT NULL DEFAULT '',
  `can_collapse` smallint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id_cat`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=256


Would the 256 also pose a problem?
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on May 08, 2014, 06:28:49 PM
What's the highest node ID you have?

That auto-increment=256 just tells the server what's the next AI value it should use.
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: ashkir on May 08, 2014, 06:32:22 PM
650 is the biggest node_id
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on May 08, 2014, 06:34:48 PM
That backup you indicate above... Is it a backup from the current conversion after it ran?
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: ashkir on May 08, 2014, 06:38:58 PM
after it ran. I don't know how to change it regularly as I never changed anything from tinyint to something else before.
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on May 08, 2014, 06:41:48 PM
That's strange, the column is already a smallint, which means you shouldn't get the error again... Did you try to re-run the converter after the error?
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: ashkir on May 08, 2014, 06:48:29 PM
Ran it the export for categories is:

CREATE TABLE IF NOT EXISTS `smf_categories` (
  `id_cat` tinyint(4) unsigned NOT NULL AUTO_INCREMENT,
  `cat_order` tinyint(4) NOT NULL DEFAULT '0',
  `name` varchar(255) NOT NULL DEFAULT '',
  `can_collapse` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id_cat`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=256 ;


Sorry. I tried running again same error. I tried uploading it changed to smallint that didn't work.
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on May 08, 2014, 06:55:12 PM
Ah, tinyint! :)

So, go to your SMF database, go to "SQL" tab and paste this:
ALTER TABLE smf_categories CHANGE id_cat id_cat SMALLINT( 4 ) UNSIGNED NOT NULL AUTO_INCREMENT ;
ALTER TABLE smf_boards CHANGE id_board id_board SMALLINT( 4 ) UNSIGNED NOT NULL AUTO_INCREMENT ;
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: ashkir on May 08, 2014, 07:01:55 PM
Thank you margarett! I searched Google and these forums for that error, out of many, many threads, you were the first to post a fix. It worked :)
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: ashkir on May 08, 2014, 07:35:05 PM
Hi again.

step=4
Database Error: Duplicate entry '419876-270' for key 'last_message'


Do we have too many topics/threads now?

our highest topic and post id:
68503 topics 610101 posts
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on May 08, 2014, 07:53:54 PM
No, that's a different error... That's a duplicate error content
The easiest way to fix it is to tell the converter to ignore that... Open the file, find this

$smcFunc['db_insert']('insert',
$prefix_smf . 'topics',

Replace with:

$smcFunc['db_insert']('ignore',
$prefix_smf . 'topics',
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: ashkir on May 08, 2014, 07:59:28 PM
Trying again. Thank you so much! <33. You are awesome.
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: ashkir on May 08, 2014, 09:12:47 PM
It froze at Now retrieving posts 85701 to 85750...

I'm upping the queries to see if it helps. that was 1715 attempts at data at 50.
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: ashkir on May 09, 2014, 02:43:24 AM
Increased the queries up a bit. Got it up to 630000. :(. Still need to go about another 300,000 the script just quits. Is there a way to resume from where it left off?
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on May 09, 2014, 04:05:40 AM
What do mean by "quits"? Is there any error?

As for resume, not really...
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: ashkir on May 09, 2014, 07:11:07 PM
It just pauses for me :( The page just simply stops loading. There's no more loading symbol, no new retrieving posts status. I tried it around 6 times before finally I got it to do every post on the test database. It's doing the same on poll votes.

Here's a screenshot: http://i.imgur.com/HgUQ1JX.png

Sorry. It just seems to freeze at a few random times. Happened most commonly with the actual posts retrieving. We're using a test database that has around 200k less posts then the live one does.

Edit: Tried again. It quits on the now retrieving poll votes 1 - xx query number.

Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on May 09, 2014, 08:07:04 PM
That's either a PHP error (should cause a white page, though...) or a MySQL "dead" connection, I think. Can you check for any PHP error logs you might have? I'm thinking maybe a "time limit" error, maybe, but unlikely...

You should really increase the "$max_queries" variable, though... 50 at a time with so many content should take you ages...

I'm sorry, with the current form of the converter, there isn't much more debug we can do. If you had a problem with the conversion script (say, eg, "duplicate entry") you would see an error, like you already did. This seems to me more a server issue than a script problem...

Anyway, you can increase the number of queries and also increase the time the script pauses between each "batch". You can find, throughout the file, some "sleep(1);" instructions. This is 1s pause between each batch of search/inserts. Try to increase that, it should reduce some load on the server, but it will take you more time to do the conversion...
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: ashkir on June 11, 2014, 10:32:05 AM
Database Error: Unknown column 'p.last_edit_date' in 'field list'

Any chance you know how to fix that error? :/
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on June 11, 2014, 03:35:30 PM
Which XF version are you running?
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: ashkir on June 11, 2014, 05:57:20 PM
1.1. It worked on the web interface. But, I was trying to do it offline on wampserver.


Oooh  I see. Some difference. Forgot I upgraded the test site to 1.2

1.2 posts table http://i.imgur.com/vAZrseH.png

1.1 posts table: http://i.imgur.com/leD5HxL.png

Edit: I'll upgrade the database later after I get some sleep. >< Thanks margarett! Any chance it'd be possible to skip over edit date, etc? That's not really neccessary for us. We really just care about getting the posts on SMF ^_^
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on June 11, 2014, 06:00:54 PM
Yes, that's the issue. I've never seen a 1.1 database.
Can you update your XF install?

Edit: yes, it is. I need to have a look at the code ;)
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: ashkir on June 12, 2014, 01:49:09 AM
Thanks! Anything you'd like to see of XenForo let me know. ^_^. Though my database is about 3.5 GB. Takes a while to do anything, haha. I also love how simple your converter is.

Edit: Got it converting posts now \o/
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: ashkir on June 12, 2014, 01:32:02 PM
I upgraded to 1.2 and tried again. Damn.

Warning: Invalid argument supplied for foreach() in C:\wamp\www\smf\xf2smf.php on line 1054

Getting that on step 5. >< Sorry I'm having errors :( I'm also trying this on offline mode so I can import thousands at a time.
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: Xarkurai on June 12, 2014, 03:42:16 PM
Hey margarett, I still have to thank you for this awesome converter.
I used it to get back to SMF.

Woohot!
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on June 12, 2014, 07:55:36 PM
Quote from: ashkir on June 12, 2014, 01:32:02 PM
Warning: Invalid argument supplied for foreach() in C:\wamp\www\smf\xf2smf.php on line 1054
Hummm that is weird... Can you have PMs without recipients? :o
Can you please add, before line 1054:

echo '<pre>';
echo $value['recipients'];
print_r($temp);
echo '</pre>';

And try again? It will give you the same error but some new info should be given. Depending on the number of PMs you have, it's possible it fills your screen with info :P I just need some lines before the actual error.

Quote from: XaR on June 12, 2014, 03:42:16 PM
Hey margarett, I still have to thank you for this awesome converter.
I used it to get back to SMF.

Woohot!
Thanks :)
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: Ninja ZX-10RR on June 13, 2014, 03:19:17 AM
I don't think I will ever use it since I am already on SMF but I wanted to say congrats for creating such a difficult thing and also for supporting it like this. You are awesome, my respect for you is very high, for this and for many other things you have done here, for me and not only for me.
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: p13t3rm on August 12, 2014, 10:43:19 PM
Thanks a lot for this, I'm currently getting stuck on step 3 on a XenForo 1.2.2 install.
Here's a full transcript of whats shown:
Boards cleared from SMF table. Next step, how many boards are in XF "node" table and whose category id is "Forum"/"ForumLink"? 6 boards and 0 "redirect boards" were found in XF.

Notice: Undefined offset: 0 in /home2/billybob/public_html/smf_forum/xf2smf.php on line 547

Notice: Undefined offset: 0 in /home2/billybob/public_html/smf_forum/xf2smf.php on line 547

Notice: Undefined offset: 0 in /home2/billybob/public_html/smf_forum/xf2smf.php on line 547

Notice: Undefined offset: 0 in /home2/billybob/public_html/smf_forum/xf2smf.php on line 547

Notice: Undefined offset: 0 in /home2/billybob/public_html/smf_forum/xf2smf.php on line 547

Notice: Undefined offset: 0 in /home2/billybob/public_html/smf_forum/xf2smf.php on line 547
An Error Has Occurred!

The database value you're trying to insert does not exist: id_cat


Any help would be greatly appreciated!

Thanks again
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on August 15, 2014, 10:36:53 AM
Don't you have any categories? I mean, all your boards are directly on the root?
Can I have a link to your XF forum? (via PM if you don't want to post it here)
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: SaltedWeb on February 02, 2015, 10:25:11 AM
Thank you for the referral going to take me some research I do not work allot with the DB on my server so when it says install withing it ,
the thought went beyond my pay grade. I do like the possibilities of doing this. But I was semis lost from the beginning using database installs as you mentioned.
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on February 02, 2015, 11:03:11 AM
Well, you always need to install SMF in order to convert (or any other software, for that matter :P ).
In this case you are just required to have it in the same database as XF is running (which should normally be painless ;) )

30 minutes-run:
* Set XF in "maintenance mode" (so that no one can access/post/etc).
* backup everything. If you have cPanel it should allow you to generate a full backup in minutes
* install SMF in the same DB where XF is.
* try the converter

If the conversion is successful and if your forum is big, it should take you more than 30 minutes :P But you can only know by trying

In either case, your XF setup should be left untouched ;)
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: SaltedWeb on February 02, 2015, 11:17:36 AM
On this page I didnt see a converter ?
http://download.simplemachines.org/?converters
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on February 02, 2015, 11:27:09 AM
Nop, this is not an official converter sorry... Read the first post of this topic carefully. Everything you need to know is there ;)
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: SaltedWeb on February 02, 2015, 11:57:36 AM
Ok I saw it under the attachments you posted , great I will look carefully thank you,
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: sc4t on August 01, 2015, 09:04:59 AM
Hello!

The converter has stoper
QuoteNow retrieving posts 46801 to 46850...

Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on August 01, 2015, 09:55:29 AM
I would assume that the converter stopped because the server didn't answer. You might need to increase the wait time between operations...
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: sc4t on August 02, 2015, 05:17:37 AM
Bonjour!

How should I do ?
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on August 03, 2015, 03:46:47 PM
Find this code
//Did we finish or WHAT?!
if ($counter >= $num_posts)
$done = true;
else
sleep(1);

See the sleep(1)? Increase it to a higher value. Do note that will make the conversion much slower.
You can also decrease the variable $max_queries = 50; at the beginning of the file. Both operations will  make the converter "lighter", while significantly increasing the time it takes...
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: sc4t on August 05, 2015, 03:21:38 AM
Thank you very much
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: sc4t on January 17, 2016, 03:46:18 AM
 :'(

Hello! I have an error message

QuoteErreur de base de données
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on January 17, 2016, 06:03:24 AM
Go to phpmyadmin and check your smf_log_errors. The last entry should be what cause that error
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: sc4t on January 17, 2016, 08:58:06 AM
Erreur de base de donn&#233;es: Duplicate entry '134291-59' for key 'first_message'
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: sc4t on January 18, 2016, 02:15:11 AM
I still have the same error message at the same location
Erreur de base de données: Duplicate entry '134291-59' for key 'first_message'
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on January 18, 2016, 06:57:05 AM
Sorry I've been out of the computer for several days. As soon as I get back to it I'll suggest a fix for you
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: sc4t on January 19, 2016, 05:56:27 AM
can you me help is it you please :'(
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: sc4t on January 19, 2016, 06:59:58 AM
QuoteErreur de base de donn&#233;es: Duplicate entry '134291-59' for key 'first_message'<br /><br /><br />      INSERT INTO `db598946955`.smf_topics(`id_topic`, `is_sticky`, `id_board`, `id_first_msg`, `id_last_msg`, `id_member_started`, `id_member_updated`, `id_poll`, `id_previous_board`, `id_previous_topic`, `num_replies`, `num_views`, `locked`, `unapproved_posts`, `approved`)<br />      VALUES<br />         (13410, 0, 68, 134593, 134593, 1, 1, 0, 0, 0, 0, 69, 1, 0, 1),<br />         (13411, 0, 68, 134594, 134594, 1, 1, 0, 0, 0, 0, 71, 1, 0, 1),<br />         (13412, 0, 68, 134595, 134595, 1, 1, 0, 0, 0, 0, 76, 1, 0, 1),<br />         (13413, 0, 68, 134596, 134596, 1, 1, 0, 0, 0, 0, 79, 1, 0, 1),<br />         (13414, 0, 68, 134597, 134597, 1, 1, 0, 0, 0, 0, 88, 1, 0, 1),<br />         (13415, 0, 68, 134598, 134598, 1, 1, 0, 0, 0, 0, 77, 1, 0, 1),<br />         (13416, 0, 68, 134599, 134599, 1, 1, 0, 0, 0, 0, 60, 1, 0, 1),<br />         (13417, 0, 68, 134600, 134600, 1, 1, 0, 0, 0, 0, 61, 1, 0, 1),<br />         (13418, 0, 68, 134601, 134601, 1, 1, 0, 0, 0, 0, 65, 1, 0, 1),<br />         (13419, 0, 68, 134602, 134602, 1, 1, 0, 0, 0, 0, 55, 1, 0, 1),<br />         (13420, 0, 68, 134603, 134603, 1, 1, 0, 0, 0, 0, 83, 0, 0, 1),<br />         (13421, 0, 73, 134604, 134604, 926, 926, 0, 0, 0, 0, 70, 0, 0, 1),<br />         (13422, 0, 59, 134606, 134613, 219, 1, 0, 0, 0, 7, 245, 0, 0, 1),<br />         (13424, 0, 53, 134615, 134893, 929, 1027, 0, 0, 0, 3, 88, 0, 0, 1),<br />         (13425, 0, 63, 134616, 134756, 929, 929, 0, 0, 0, 4, 180, 0, 0, 1),<br />         (13426, 0, 53, 134617, 134665, 929, 942, 0, 0, 0, 3, 131, 0, 0, 1),<br />         (13427, 0, 59, 134618, 134703, 929, 929, 0, 0, 0, 6, 270, 0, 0, 1),<br />         (13428, 0, 53, 134623, 134625, 931, 1, 0, 0, 0, 1, 69, 0, 0, 1),<br />         (13430, 0, 54, 134629, 134631, 932, 932, 0, 0, 0, 2, 114, 0, 0, 1),<br />         (13435, 0, 53, 134637, 134664, 934, 942, 0, 0, 0, 3, 128, 0, 0, 1),<br />         (13436, 0, 59, 134638, 134899, 934, 1, 0, 0, 0, 16, 734, 0, 0, 1),<br />         (13437, 0, 68, 134648, 134648, 1, 1, 0, 0, 0, 0, 103, 1, 0, 1),<br />         (13438, 0, 54, 134650, 134656, 1, 942, 0, 0, 0, 1, 95, 0, 0, 1),<br />         (13439, 0, 63, 134653, 134654, 936, 1, 0, 0, 0, 1, 113, 0, 0, 1),<br />         (13441, 1, 52, 134658, 134658, 1, 1, 0, 0, 0, 0, 211, 0, 0, 1),<br />         (13442, 0, 68, 134660, 134660, 1, 1, 0, 0, 0, 0, 18, 0, 0, 1),<br />         (13443, 0, 68, 134661, 134661, 1, 1, 0, 0, 0, 0, 26, 0, 0, 1),<br />         (13446, 0, 53, 134668, 134693, 924, 9, 0, 0, 0, 3, 701, 0, 0, 1),<br />         (13447, 0, 60, 134669, 134724, 924, 1, 0, 0, 0, 18, 282, 0, 0, 1),<br />         (13448, 0, 68, 134676, 134676, 1, 1, 0, 0, 0, 0, 38, 0, 0, 1),<br />         (13450, 0, 59, 134689, 134704, 929, 929, 0, 0, 0, 5, 201, 0, 0, 1),<br />         (13451, 0, 54, 134706, 134706, 1, 1, 0, 0, 0, 0, 47, 0, 0, 1),<br />         (13455, 0, 54, 134711, 134715, 130, 1, 0, 0, 0, 4, 106, 0, 0, 1),<br />         (13457, 0, 68, 134717, 134717, 1, 1, 0, 0, 0, 0, 51, 0, 0, 1),<br />         (13458, 0, 59, 134291, 134916, 130, 1, 0, 0, 0, 15, 663, 0, 0, 1),<br />         (13459, 0, 59, 134722, 134759, 924, 1, 0, 0, 0, 9, 87, 0, 0, 1),<br />         (13460, 0, 63, 134726, 134729, 1017, 1, 0, 0, 0, 1, 66, 0, 0, 1),<br />         (13461, 0, 59, 134730, 134737, 1018, 1, 0, 0, 0, 3, 73, 0, 0, 1),<br />         (13462, 0, 60, 134738, 134748, 1020, 1, 0, 0, 0, 3, 86, 0, 0, 1),<br />         (13464, 0, 68, 134740, 134740, 1020, 1020, 0, 0, 0, 0, 26, 0, 0, 1),<br />         (13465, 0, 60, 134739, 134739, 1020, 1020, 0, 0, 0, 0, 38, 0, 0, 1),<br />         (13466, 0, 68, 134742, 134742, 1, 1, 0, 0, 0, 0, 28, 0, 0, 1),<br />         (13468, 0, 68, 134744, 134744, 1, 1, 0, 0, 0, 0, 30, 0, 0, 1),<br />         (13469, 0, 68, 134745, 134746, 1, 1, 0, 0, 0, 1, 62, 0, 0, 1),<br />         (13470, 0, 60, 134749, 134750, 1019, 1, 0, 0, 0, 1, 75, 0, 0, 1),<br />         (13471, 0, 56, 134751, 134751, 1, 1, 0, 0, 0, 0, 38, 0, 0, 1),<br />         (13472, 0, 59, 134752, 134755, 929, 929, 0, 0, 0, 3, 58, 0, 0, 1),<br />         (13473, 0, 68, 134760, 134760, 1, 1, 0, 0, 0, 0, 8, 0, 0, 1),<br />         (13474, 0, 68, 134761, 134761, 1, 1, 0, 0, 0, 0, 26, 0, 0, 1),<br />         (13475, 0, 68, 134762, 134762, 1, 1, 0, 0, 0, 0, 12, 0, 0, 1)
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on January 19, 2016, 06:53:55 PM
Hello.

Sorry for the late reply, I've been extremely busy...
Edit the converter file, find:
$smcFunc['db_insert']('insert',
$prefix_smf . 'topics',

Replace with:
$smcFunc['db_insert']('ignore',
$prefix_smf . 'topics',
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: sc4t on January 20, 2016, 12:54:53 AM
thank you very much  :D

2 New error message

QuoteWarning: unlink(/homepages/46/d569266866/htdocs/clickandbuilds/ScooterChinois4T/smf/attachments/Avatars): Is a directory in /homepages/46/d569266866/htdocs/clickandbuilds/ScooterChinois4T/smf/xf2smf.php on line 1157
Attachments folder is now empty. Now we will start the copy operation.
Depending on the number of files you have, this can take some time...
Copying attachments 1 to 50...
Warning: copy(/internal_data/attachments/0/1726-d84ddc27854255da454ecafd94dac5e6.data): failed to open stream: No such file or directory in /homepages/46/d569266866/htdocs/clickandbuilds/ScooterChinois4T/smf/xf2smf.php on line 1258

Warning: copy(/internal_data/attachments/0/1725-4d3172945cf1a53077f8f886f7058f4e.data): failed to open stream: No such file or directory in /homepages/46/d569266866/htdocs/clickandbuilds/ScooterChinois4T/smf/xf2smf.php on line 1258

Warning: copy(/internal_data/attachments/0/1724-67f93a08db21ab6e29c403adc9b03525.data): failed to open stream: No such file or directory in /homepages/46/d569266866/htdocs/clickandbuilds/ScooterChinois4T/smf/xf2smf.php on line 1258

QuoteThis is the seventh step of the conversion. We will now copy and convert User Avatars


Please make sure that you've reached here from the sixth step (Post Attachments) as both work the same
table in SMF's structure so it's really important the sequence is maintained.
We will now try and fetch all existing avatars datas, from XF's data/avatars/l sub-folders
It can happen that this results in a huge array. If memory is exceeded, this will need a serious overhaul...

Warning: dir(/data/avatars/l): failed to open dir: No such file or directory in /homepages/46/d569266866/htdocs/clickandbuilds/ScooterChinois4T/smf/xf2smf.php on line 2071

Fatal error: Call to a member function read() on a non-object in /homepages/46/d569266866/htdocs/clickandbuilds/ScooterChinois4T/smf/xf2smf.php on line 2073
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: sc4t on January 20, 2016, 02:46:58 AM
Copie d'ecran
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on January 20, 2016, 04:08:00 AM
You didn't set XF's path. Check the instructions on the first post ;)
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: sc4t on January 20, 2016, 04:54:01 AM
I still have the error message for the parts attached
It lacks all the latest topics and messages posted in December and January.
Missing also all users registered in the December and January

Forum xenforo
http://www.scooter-chinois-4t.com/forum/

vs

Forum smf
http://www.scooter-chinois-4t.com/smf

pseudo: margarett
Passe: 123456
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on January 20, 2016, 06:14:09 AM
But did you fix XF's path in the converter?

As for the latest posts I have no idea. I'd need to check in place, sorry. If you are comfortable with the idea PM me (do NOT post in this topic) access to your cPanel or other control panel you might be using. I need to check the databases and run the converter myself to understand what's wrong...
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: sc4t on January 20, 2016, 06:54:40 AM
Private message send  :)
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on January 20, 2016, 07:06:27 AM
Thank you. I've seen it but I can only work on it later tonight
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: sc4t on January 20, 2016, 07:24:04 AM
Quote from: sc4t on January 20, 2016, 04:54:01 AM
I still have the error message for the parts attached
It lacks all the latest topics and messages posted in December and January.
Missing also all users registered in the December and January

Forum xenforo
http://www.scooter-chinois-4t.com/forum/

vs

Forum smf
http://www.scooter-chinois-4t.com/smf

pseudo: margarett
Passe: 123456

Missing also the archive forum created in January
http://www.scooter-chinois-4t.com/forum/forums/archives.79/
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on January 20, 2016, 07:00:38 PM
I now checked in place. I didn't check the attachments issue but the converter worked just fine regarding topics.

The last topic in XF's database (table xf_thread) is ID 13586, also the last in SMF's converted database
http://www.scooter-chinois-4t.com/forum/threads/probleme-dans-les-monte.13586/
http://www.scooter-chinois-4t.com/smf/index.php?topic=13586.0
There are some newer topics in your forum which are not converted over to SMF because, well, I don't know where XF is storing them ??? They are NOT in xf_thread and xf_post tables!

Same for posts. The last post ID stored in xf_post is 134923, as it's also in SMF's smf_messages...
http://www.scooter-chinois-4t.com/forum/threads/probleme-dans-les-monte.13586/#post-134923
http://www.scooter-chinois-4t.com/smf/index.php?topic=13586.msg134923#msg134923

My guess is that this "archive" you created moved database content to another database. And that is not supported by this converter (not by any other converter I know)

As far as I can tell, the converter is working fine. It's your database setup which seems kinda odd :(
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on January 20, 2016, 07:29:20 PM
About the attachments. There are several hundred attachments in SMF's "attachments" folder so I guess it worked for the most part...

QuoteWarning: unlink(/homepages/46/d569266866/htdocs/clickandbuilds/ScooterChinois4T/smf/attachments/Avatars): Is a directory in /homepages/46/d569266866/htdocs/clickandbuilds/ScooterChinois4T/smf/xf2smf.php on line 1157
This suggests that you had a folder inside "attachments" named "Avatars" which the converter doesn't really expect. Anyway it's a harmless warning.

QuoteWarning: copy(/internal_data/attachments/0/1726-d84ddc27854255da454ecafd94dac5e6.data): failed to open stream: No such file or directory in /homepages/46/d569266866/htdocs/clickandbuilds/ScooterChinois4T/smf/xf2smf.php on line 1258
Warning: copy(/internal_data/attachments/0/1725-4d3172945cf1a53077f8f886f7058f4e.data): failed to open stream: No such file or directory in /homepages/46/d569266866/htdocs/clickandbuilds/ScooterChinois4T/smf/xf2smf.php on line 1258
Warning: copy(/internal_data/attachments/0/1724-67f93a08db21ab6e29c403adc9b03525.data): failed to open stream: No such file or directory in /homepages/46/d569266866/htdocs/clickandbuilds/ScooterChinois4T/smf/xf2smf.php on line 1258
This simply means that a file which is referenced in XF's attachments table doesn't actually exist in the respective folder. Not a big deal, it happens ;)

This, however
QuoteWarning: dir(/data/avatars/l): failed to open dir: No such file or directory in /homepages/46/d569266866/htdocs/clickandbuilds/ScooterChinois4T/smf/xf2smf.php on line 2071
Fatal error: Call to a member function read() on a non-object in /homepages/46/d569266866/htdocs/clickandbuilds/ScooterChinois4T/smf/xf2smf.php on line 2073
Is odd. User avatars *were* converted so the step actually worked.

Bottom line: overall the converter did its job just fine :)
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: sc4t on January 21, 2016, 12:43:24 AM
Hello!

Thanks for your help...
It still lacks the subjects and message December January   :o

Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on January 21, 2016, 04:08:25 AM
That's what I was trying to explain: these recent posts are NOT in the database. They should be stored in another database or table. I would advise you to check with XF's support now to undo that "archive" you did, because it seems to me that the missing posts were created after this.
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: sc4t on March 13, 2016, 07:57:34 AM
The problem of ghost subjects is resolved.  :)
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: sc4t on March 13, 2016, 08:25:10 AM
Une erreur s'est produite !

Wrong value type sent to the database. Integer expected. (id_member)

Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: sc4t on March 21, 2016, 09:44:37 AM
The problem with private messages is resolved.
Now I have a new error with polls

QuoteThis is the eight step of the conversion. We will now convert Polls


First, let's trash the actual contents of SMF "polls", "poll_choices" and "log_polls" tables....
Polls cleared from SMF tables. Next step, count what's there to move?? 0 polls, 0 poll responses and 0 poll votes were found in XF.
Now retrieving polls 1 to 0...
Database Error

Please try again. If you come back to this error screen, report the error to an administrator.
Back
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on March 21, 2016, 01:59:44 PM
Eh :P Never thought about that... When there's nothing to convert it still tries to insert an empty row. I'll fix that shortly
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: anon228 on March 22, 2016, 11:37:08 AM
at step 5 get this error
QuotePMs cleared from SMF tables. Next step, count what's there to move?? 164076 PMs were found in XF.
Now retrieving messages 1 to 350...
Warning: Invalid argument supplied for foreach() in C:\Winginx\home\site.com\public_html\smf\xf2smf.php on line 1054
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: anon228 on March 22, 2016, 11:55:37 AM
another error
Quote
Database Error
Please try again. If you come back to this error screen, report the error to an administrator.
Back
Warning: Cannot modify header information - headers already sent by (output started at C:\Winginx\home\site.com\public_html\smf\xf2smf.php:34) in C:\Winginx\home\site.com\public_html\smf\Sources\Errors.php on line 346 Warning: Cannot modify header information - headers already sent by (output started at C:\Winginx\home\site.com\public_html\smf\xf2smf.php:34) in C:\Winginx\home\site.com\public_html\smf\Sources\Errors.php on line 347 Warning: Cannot modify header information - headers already sent by (output started at C:\Winginx\home\site.com\public_html\smf\xf2smf.php:34) in C:\Winginx\home\site.com\public_html\smf\Sources\Errors.php on line 348 Warning: Cannot modify header information - headers already sent by (output started at C:\Winginx\home\site.com\public_html\smf\xf2smf.php:34) in C:\Winginx\home\site.com\public_html\smf\Sources\Errors.php on line 351 Warning: Cannot modify header information - headers already sent by (output started at C:\Winginx\home\site.com\public_html\smf\xf2smf.php:34) in C:\Winginx\home\site.com\public_html\smf\Sources\Errors.php on line 352 Warning: Cannot modify header information - headers already sent by (output started at C:\Winginx\home\site.com\public_html\smf\xf2smf.php:34) in C:\Winginx\home\site.com\public_html\smf\Sources\Errors.php on line 353
Connection Problems
Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later.
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on March 22, 2016, 12:39:56 PM
@sc4t, please try the new converter attached to the first post. I don't have any XF data anymore so I can't test it though :( Fingers crossed :P
It seems you found and fixed some errors, would it be possible for you to let me know if you changed something in the converter in that process?

@anon228, the file I just uploaded won't be of use for you because it doesn't touch anything related to PMs. In version you're using, line 1054 is:
$temp = unserialize($value['recipients']);
>>>>>>>> foreach ($temp as $key2 => $value2)
{
if (($key2 != $value['last_message_user_id']) && ($key2 != $value['id_starter'])) //prevent duplicates
$recipients[] = $key2;
}
unset($temp);

It seems that the fetched value isn't serialized as expected. I would suggest you change that bit to:
$temp = unserialize($value['recipients']);
if (is_array($temp))
{
foreach ($temp as $key2 => $value2)
{
if (($key2 != $value['last_message_user_id']) && ($key2 != $value['id_starter'])) //prevent duplicates
$recipients[] = $key2;
}
}
unset($temp);
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: sc4t on March 23, 2016, 09:01:41 AM
Bonjour!

Always the same error message with the polls.

QuoteThis is the eight step of the conversion. We will now convert Polls


First, let's trash the actual contents of SMF "polls", "poll_choices" and "log_polls" tables....
Polls cleared from SMF tables. Next step, count what's there to move?? 0 polls, 0 poll responses and 0 poll votes were found in XF.
Now retrieving polls 1 to 0...
Erreur de base de données

Merci de r�essayer. Si l'erreur se reproduit, signalez cette erreur � un administrateur.
Retour.

There is also a problem with the file attachments.

http://www.scooter-chinois-4t.com/smf/tutoriels/comment-enlever-la-rouille-de-piece-metallique/msg134165/#msg134165
http://www.scooter-chinois-4t.com/forum/threads/comment-enlever-la-rouille-de-piece-metallique.13196/
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on March 23, 2016, 02:48:04 PM
That cannot happen. If there are no polls it should now skip that part completely. Can you please attach your current file?
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: sc4t on March 23, 2016, 03:25:19 PM
Oui
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on March 23, 2016, 03:49:50 PM
Your file is still the old version, make sure you re-download the zip file on the first post ;)
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: sc4t on March 24, 2016, 02:26:43 AM
I download the new file and still the problem with attachments
Xenforo: http://www.scooter-chinois-4t.com/forum/threads/le-carburateur-de-a-a-z.13524/
SMF: http://www.scooter-chinois-4t.com/smf/tutoriels/le-carburateur-de-a-a-z-13524/msg134813/#msg134813
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on March 24, 2016, 05:54:52 AM
That's a different problem altogether... I can look into that issue for you but I need access to your files and databases...

Attachments are converted over a simple method:
a) check XF's posts table and fetch posts with attachments
b) for each of these posts, get the respective attachment name, hash, etc. This allows to identify the file on disk.
c) directly copy it from XF_FOLDER/internal_data/attachments/0/ to SMF_FOLDER/attachments
//Now, we need to get the hashed file name from XF and convert it to a lovely filename. One we can actually use, ya know? :)
$oriname = $xf_dir . '/internal_data/attachments/0/' . $temp2['data_id'] . '-' . $temp2['file_hash'] . '.data';
//Destination (temporary) name
$destname = $smf_dir . '/attachments/' . $temp2['filename'];
$test = copy($oriname, $destname);

d) perform some SMF-specific hash/rename operations and add it to SMF's attachments table.

That's it.
If the file copy operation fails, that's because the file cannot be found. In order to check that I need to see in place which files are in place and where they are located.
The post body content isn't really touched. So it seems that XF is using some kind of "inline attachments" to show the image through a BB Code that SMF can't understand. That might be "convertible" but I am really not sure, I need to check in place.
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: sc4t on March 24, 2016, 07:23:30 AM
Thank you! I give you the password via private message  :)
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: sc4t on March 30, 2016, 01:29:08 AM
I was forgotten  :'(
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: sc4t on April 20, 2016, 01:35:41 AM
Hello Margarett

You new to the script ??
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: Refaeliadria on May 02, 2016, 06:46:12 AM
Quick question and for some reason I can't remember how to define the root directory for the xenforo install.
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on May 02, 2016, 07:34:55 AM
Quote from: margarett on October 06, 2013, 05:09:45 PM

How to use this converter:
(...)
3 - Download the attached "xf2smf.php" file to you computer and edit it with a decent editor (eg: Notepad++). The small edits that are needed are all localized in this part here:
(https://www.simplemachines.org/community/index.php?action=dlattach;topic=512266.0;attach=225037;image)
3.1 - You need to define the folder where XF is installed. By folder, I mean the server path where XF's installation is located. SMF's path is automatically discovered (because you will put the file there :P ). If you don't know it, please upload the attached "whats_the_path.php" file to XF's folder and run it via browser. It will tell you the path you should add.

It's the variable $xf_dir
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: sudeep10 on July 25, 2016, 06:51:39 AM
anyone can help me out. I want to update from xenforo to smf.
I can pay for the right solution as well.
I am a noob when it comes to programming and coding, It just pass away from my mind.
Anyone can help me out?
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: margarett on July 25, 2016, 12:07:46 PM
Did you try to run the converter? Do you get any errors?

What is your XF version?
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: Marzia on November 13, 2016, 03:05:19 AM
does this work for xenforo 1.5.10? I want to move to SMF instead since xenforo keeps giving us problems... .-.
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: sc4t on January 17, 2017, 03:55:28 AM

Hello margarett!
What's new for the conversion script xenforo 1.5.10??
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: wEbAddEr on January 21, 2017, 10:43:48 AM
The import script works all the way but when it start to import the posts it gives a error:
xenForo 1.5.10

An Error Has Occurred!
The database value you're trying to insert does not exist: id_board
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: novice68 on May 07, 2018, 10:13:12 AM
I know this is an old thread, but I have a question on the converter.

I'm an active mod on a forum that has about 1500 registered users and over 15,000 posts. The current forum owner wants to 'retire' but needs to keep the domain for professional reasons. He offered to shift the existing forum to one of the mods, if we wanted to take it on, and I decided to give it a try. He currently uses Xenforo but I'd prefer to try SMF. I have a new domain and hosting set up already. I also have SMF installed along with this converter. From the instructions, it looks like I only need the current xenforo database and not a full install of xenforo. I believe I can put the xenforo database anywhere as long as I link to the path. Is this a correct assumption? Or do I need to install xenforo in order for this converter to function correctly?

Questions regarding conversion:
Quote3.2 - You need to adjust my "$max_queries" variable. This defines how many registers the converter tries to move at once. A low number takes a LOT of time, a large number will hammer your server and may cause it to become unresponsive.

What number am I entering for this step: I'm not sure what the queries represents, is it number of users, posts, or some code detail that I don't understand?

Quote3.3 - As my image above states, I didn't find a way to change XF's table prefix, so it shouldn't be necessary to change anything else. But, in case your prefix isn't "xf_" please edit the corresponding line.

I asked for a copy of the current database to test it and he sent me a file called xenforo.sql. Is this the correct file to use? If so, do I need to rename it xf.sql? Or should I request a different file type?

Thank you for any help you can provide.

Christa
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: Illori on May 07, 2018, 10:19:49 AM
do you have a web server? you need to upload the backup to the database server. you would also need whatever xf's version of Settings.php is that will let SMF connect to the database.
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: novice68 on May 07, 2018, 11:40:29 AM
I do have a web server. I suspected I needed a php file as well but didn't see it specifically listed in the instructions.

Sorry for the simplistic questions. As you can tell, I don't write code and I only have a very (VERY) basic understanding of files and structures and how they link.
Title: Re: [Converter] XenForo 1.2 --> SMF 2.0.x
Post by: GigaWatt on May 07, 2018, 05:46:58 PM
Quote from: novice68 on May 07, 2018, 10:13:12 AM
I asked for a copy of the current database to test it and he sent me a file called xenforo.sql. Is this the correct file to use? If so, do I need to rename it xf.sql? Or should I request a different file type?

I don't know the answer to your first question (try reading the thread, there might be an answer there), but to your second one, yes, that's the forum's database. I suggest you zip it when uploading it through the database manager (phpMyAdmin). The files usually have to end with .sql.zip. For example, if you zip the xenoforo.sql database, your file should be named xenoforo.sql.zip.

You could name it however you like, as long as the name is not too long and it doesn't contain special characters (i.e., regular ANSI letters and numbers are allowed).

Quote from: novice68 on May 07, 2018, 11:40:29 AM
I do have a web server. I suspected I needed a php file as well but didn't see it specifically listed in the instructions.

There's an attachment in the first post in the thread, xf2smf.ZIP (https://www.simplemachines.org/community/index.php?action=dlattach;topic=512266.0;attach=247283). Download it, extract the content and use the xf2smf.php file.