Sorry if I shouldnt start a new thread re this, but I am having trouble converting a YABB 2.1 forum to SMF.
Following is the conversion report I am getting, it seems to have numerous errors in it.
Can anyone advise what I have done wrong, what I need to do to get this to work.
Any help appreciated.
Jon
Quote
Converting...
Notice: Undefined index: convert_script in *****www.mywebsite*****/htdocs/smf/convert.php on line 580
Warning: Invalid argument supplied for foreach() in *****www.mywebsite*****/htdocs/smf/convert.php on line 583
Notice: Undefined index: convert_script in *****www.mywebsite*****/htdocs/smf/convert.php on line 588
Successful.
Recalculating forum statistics...
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1827
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1828
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 935
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 945
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1827
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1828
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 953
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 963
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1827
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1828
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 976
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 989
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1827
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1828
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 1035
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 1037
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1827
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1828
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 1043
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 1049
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1827
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1828
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 1060
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 1061
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1827
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1828
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 1069
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 1071
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1827
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1828
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 1077
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 1078
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1827
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1828
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 1084
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 1085
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1827
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1828
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1827
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1828
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 1109
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 1111
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1827
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1828
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 1117
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 1129
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1827
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1828
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1827
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1828
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 1154
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 1156
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1827
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1828
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 1192
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 1193
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1827
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1828
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 1231
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 1236
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1827
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1828
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 1297
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 1299
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1827
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1828
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 1335
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 1354
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1827
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1828
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1827
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1828
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1827
Notice: Undefined variable: result in *****www.mywebsite*****/htdocs/smf/convert.php on line 1828
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 1377
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in *****www.mywebsite*****/htdocs/smf/convert.php on line 1378
Successful.
Conversion Complete
Congratulations, the conversion has completed successfully. If you have or had any problems with this converter, or need help using SMF, please feel free to look to us for support.
Please check this box to delete the converter right now for security reasons. (doesn't work on all servers.)
Now that everything is converted over, your SMF installation should have all the posts, boards, and members from the
Notice: Undefined index: name in *****www.mywebsite*****/htdocs/smf/convert.php on line 1454
installation.
We hope you had a smooth transition!
OK, I found the problem. Had something to do with php sessions which I have rectified.
I now get this result.......
Converting...
Converting membergroups... Successful.
Converting members... Unsuccessful!
This query:
ALTER TABLE `vfr_smf`.smf_members
ORDER BY ID_MEMBER = 0, dateRegistered;
Caused the error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= 0, dateRegistered' at line 2
I have a member list, but no posts or boards in the forum
Regards Jon
Give this file a go and let me know if it works :)
Thanks Sleepy.
It got through the above errors, but now it hangs (over an hour, before I gave up) at 'Converting posts (part 3)...'
Should I flush the database, upload and install fresh SMF, and then convert?
Regards Jon
Quote from: vfrjon on August 10, 2008, 07:31:50 AM
Thanks Sleepy.
It got through the above errors, but now it hangs (over an hour, before I gave up) at 'Converting posts (part 3)...'
Should I flush the database, upload and install fresh SMF, and then convert?
Regards Jon
Converting posts (part 3) can take hours! My forum has over 250,000 posts and part 3 takes over 4 hours to complete. Have patience! ;)
Yes the last part can take hours.
You can try to change the block_size though if you want. If your server can easily handle the larger size of data at once then go for it. You can't change it though if you are converting via command line since the file isn't reloaded.
Forum only has about 11000 posts, so its not that big.
I just let it run for a bit over an hour before the server timed out. Trying it again now......
If that fails, I will try changing the block size.
Its currently set at 100 I believe. What would you suggest? 200?
Depends on what your server can handle.
During a test of a very big board I had (it was over 500 mb), on my laptop (which is a dual 2.2 ghz, 2 gb ram, and php/mysql has no memory limits usage) I pushed it all the way to 100,000 posts at a time :D This was a Yabb 2.2 board, but it doesn't make a difference.
I think part of the issue may be missing indexes which slow down the selects. I may need to look into seeing if I can't add any sort of index there and see if it works ok still.
Stiil hangs until server times out on Converting posts (part 3)... Incomplete.
I have noticed that the stpes in the Address bar are not increasing as they had in all other steps. They are stuck at .......forum/convert.php?step=1&substep=12&cstep=12&start=0
Ive had a look at the data base it has built and populated.....
All posts are there, and looking at all the other tables in the db, they too have been populated.
I can not log in to the forum, it claims only registered usres can!
Regards Jon
Step 12 doesn't increment like the others. Since what it does in its work is attempts to remove guest posts and topics that need to be linked to profiles, it only is looking for that until it has found them all.
Though you can give the below one a try, it just increments the steps, even though it has no affect on the converter. It at least gives user feedback :P
Thanks for your replys and your patience :D
Got it to run, sort of..........
Server timed out a few times, but because the steps were displayed in the address bar, I could just hit "go" again and it would continue on. This kept up for about 6 hours and at
Step 1 Substep ~64500 cstep 12 I changed to
Step 1 Substep0 cstep 13 for fun! It continued on and displayed this......
Quote
Converting...
Cleaning up (part 2)... Unsuccessful!
This query:
SELECT t.ID_TOPIC, MIN(m.ID_MSG) AS ID_FIRST_MSG, MAX(m.ID_MSG) AS ID_LAST_MSG
FROM (`vfrsmf`.smf_topics AS t, `vfrsmf`.smf_messages AS m)
WHERE m.ID_TOPIC = t.ID_TOPIC
GROUP BY t.ID_TOPIC
LIMIT 1800, 150;
Caused the error:
The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
Run this query in phpmyadmin
SET SQL_BIG_SELECTS=1
http://dev.mysql.com/doc/refman/5.0/en/set-option.html
That is just saying that the data you are trying to grab is bigger than what is allowed in a select. You just need to tell it to ignore this for a while.
OK, Ill give that a try.
Can I restart mid conversion, or should i start from scratch again?
Should it take that long to convert (over 6 hours)? We only have about 11000 posts and 300 members. Seems a long time in reference to JMB's reply
QuoteConverting posts (part 3) can take hours! My forum has over 250,000 posts and part 3 takes over 4 hours to complete. Have patience! ;)
What is the current url after the convert.php?
I am mainly looking for the substep in that to see what it is currently at. This number should usually reflect how many of something it has converted, since this is posts it would mean most likely how many posts it has gone through in that step (Though this may be that weird step that doesn't have this done in it).
Have you also looked at the mysql process list? I used this while testing the yabb 2.2 converters to identify what it was doing exactly. It may be that it is taking so long due to it having to copy to the temp table while doing a select. Which would explain why this is taking a while.
Pretty sure the url was convert.php&step=1&substep=64500&cstep=12&start=0 when I killed it as I had to log off and go home.
No,, I havent looked at the mysql process list. I will h=get it running when I get home and have a look.
How does this one work?
OK, runs fine throught the post converting now, but still stops with the same error as shown above
(at convert.php?step=1&substep=1800&cstep=15&start=0)
This is after I set SET SQL_BIG_SELECTS=1 in myphpadmin on the SQL TAB
Can I verify this is set somehow. It returned saying it was sucsessful.
When I check in the variable list it says its off!
Are you able to browse to the SMF Forum? We might just need to do the very last step ourselves in the Admin panel under Forum Maintenance.
Yes, I can get to the forum, but cant log in any more.
Quote from: vfrjon on August 14, 2008, 02:44:48 AM
Yes, I can get to the forum, but cant log in any more.
solution:
http://www.simplemachines.org/community/index.php?topic=218449.msg1605912#msg1605912
tried a couple of variations on this,
reset password via email (no email recieved, but thats a known issue!)
reset password with question
manually edit the database with new password (Guessing MD5, but tried a few others)
via SQL command on database as per above post. Note all my ID_MEMBER fields are null, so I tried with memberName = xyz as well
Still no login. Replies with security statement to renter password, then back to login screen.
Jon
SMF should be able to detect the login from yabb (It has a password like abstraction array that can pickup other password formats to update them to its format).
If you just enter the password in plain text in the database, SMF can pick this up and update it to its method.
Thats what I thought, but when I changed the password to "test" via the above methods (can see the change in the DB) it still wont allow me to login on either of my admin accounts.
What version of PHP are you using?
Where you trying this on different browsers?
Is this on your local test site (ie localhost)?
Have you tried to change the cookiename (via settings.php)?
What version of PHP are you using? Not sure. Its running on Powweb servers, so I imagine the latest.
Where you trying this on different browsers? Firefox and IE7
Is this on your local test site (ie localhost)? No, its in a temp folder on my site
Have you tried to change the cookiename (via settings.php)? Yes, just then. No change
Most likely not the most recent versions, Most hosts don't stay on the very current versions.
Are you logging in using the top login box when it prompts the security message? It should be the one in the middle of the page that has the message.
The security login message gets prompted when you use the top login box as it uses prehashing which appears to be failing at the moment (due to it not using SMF password format).
Yes, using the one in the centre of the page, when I get these errors. Quicklog in also fails.
Do you want me to email some URL's and settings / passwords so you can take a look?
Jon
No, Its something weird in the code then thats making it occur.
Open the /Sources/LogInOut.php
Find:
// Figure out the password using SMF's encryption - if what they typed is right.
if (isset($_REQUEST['hash_passwrd']) && strlen($_REQUEST['hash_passwrd']) == 40)
Replace:
// Figure out the password using SMF's encryption - if what they typed is right.
if (0 && isset($_REQUEST['hash_passwrd']) && strlen($_REQUEST['hash_passwrd']) == 40)
This will just disable login hashing forcefully in the code :P
After entering user name and password, it now sends me to password reminder options.
Selecting "secret question" options opens a new dialogue that states user is not known!
I am now out of login chances and will have to wait till later! Is there a quick way to reset this via DB perhaps?
Played with this a bit and now have found the code and changed it from 3 to 30 attempts ;) Replaced login code with original.
I noticed on the DB that all members have an ID_MEMBER = 0 . Is this correct?
Interesting......... I changed my ID_MEMBER to 1 , and I can now log in, but imediately get this error....
QuoteThe SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
File: mywebsite/htdocs/newforum/Sources/BoardIndex.php
Line: 84
I can get to the admin tab and settings now, but with the above error and no boards shown.
LogInOut.php restored to original, and I can now log in and get to the Admin tab. (Still with above error)
So, the only change I made that is still there, is to change ID_MEMBER to 1 for my login.
Changed my other admin account ID_MEMBER = 2 and I can login with that account now too.
Another test account I have (standard member to check admin and mod boards are hidden to general members) will only login if I give a unique ID_MEMBER number as well
How many boards do you have?
Lets try this though
Admin -> Forum Maintenance
Run "Find and Repair Errors."
Then run "Recount Totals and Stats".
It could also be possible your host has turned down the max join size to something really small. Which would be stupid, but some hosts do these things :(
Run "Find and Repair Errors."
Quote
Database Error
The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
File: mywebsite/htdocs/newforum/Sources/RepairBoards.php
Line: 809
"Recount Totals and Stats".
Hangs at 60%
Max join size is 7,000,000 (from variable list)
19 boards
Ok, lets try this.
Open the /Sources/RepairBoards.php file
Find:
$to_fix = !empty($_SESSION['repairboards_to_fix']) ? $_SESSION['repairboards_to_fix'] : array();
$context['repair_errors'] = isset($_SESSION['repairboards_to_fix2']) ? $_SESSION['repairboards_to_fix2'] : array();
Add after:
db_query("SET @@SQL_BIG_SELECTS = 1" __FILE__, __LINE__);
This should force big selects to be enabled so the script can run.
Changed too.........
$to_fix = !empty($_SESSION['repairboards_to_fix']) ? $_SESSION['repairboards_to_fix'] : array();
$context['repair_errors'] = isset($_SESSION['repairboards_to_fix2']) ? $_SESSION['repairboards_to_fix2'] : array();
db_query("SET @@SQL_BIG_SELECTS = 1" __FILE__, __LINE__);Results in............
Quote
Parse error: syntax error, unexpected T_FILE in mywebsite/htdocs/newforum/Sources/RepairBoards.php on line 768
oh sorry,
db_query("SET @@SQL_BIG_SELECTS = 1", __FILE__, __LINE__);
I missed a comma.
No problems, it worked with that!
Forum maintenance now runs, found a few errors which it fixed, and Recount totals and stats runs OK too.
Still get the same error when trying to view the boards in the forum. Perhaps I need to add the
db_query("SET @@SQL_BIG_SELECTS = 1", __FILE__, __LINE__);
to the boardindex.php file too. If so , where would I put it?
Jon
Playing around, I added
db_query("SET @@SQL_BIG_SELECTS = 1", __FILE__, __LINE__);into BoardIndex.php after
// Find all boards and categories, as well as related information. This will be sorted by the natural order of boards and categories, which we control.and it makes it through that stage, but stops with this error.......
Quote2: mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Unable to save result set
File: mywebsite/htdocs/newforum/Sources/Subs.php
Line: 321
If you go to ?action=stats on your forum.
What does it say about how many boards, categories, posts, topics, etc that you have?
As well, if you use phpMyAdmin, go to smf_boards, smf_categories, smf_topics, and smf_posts. View the structure for each one, then at the bottom left is a table holding information about the indexes in that table.
Can you post each of those. I have a feeling we may be missing that data which is causing your large forum to basically overload mysql since it has no indexes to speed up the process. If any are missing we will be creating them to fix this.
I ran the maintenence routines again and got this.......
The following errors are fouling up your forum:
Found topics and/or messages with topic or message IDs of 0.
Would you like to fix these errors?
Yes - No
Selected Yes, but it doesnt fix them.
To answer your questions........
STATS
Total Members: 387
Total Posts: 0
Total Topics: 0
Total Categories: 5
Users Online: 1
Most Online: 1 - August 11, 2008, 01:29:05 AM
Online Today: 0
Total Boards: 19
Attached images of tables. There is not one for 'posts', did you mean messages?
yes sorry I meant smf_messages :P
Interesting,
If you go to smf_messages again, and click browse. Do you see any actual messages?
Yes they are all there.
Im wondering whether we need to put the sql big select command into the convert process. Remember it crashed out with the error at the end?
Had a look at the DB tables and the smf_topics table has lots of zeros!
ID_TOPIC ID, ID_LAST_MSG, ID_FIRTS_MSG, ID_MEMBER_STARTED, ID_MEMBER_UPDATED, numReplies are all zeros,
NUM_VIEWS,isStick, ID_BOARD,tempID are all populated
Anymore ideas?
Ok, its the topics table that we have an issue with then.
Is there a column still called tempId?
Yeap.
ID_TOPIC ID, ID_LAST_MSG, ID_FIRTS_MSG, ID_MEMBER_STARTED, ID_MEMBER_UPDATED, numReplies are all zeros,
NUM_VIEWS,isStick, ID_BOARD,tempID are all populated
Also noticed that there are no PM's and the PM table in the database is empty.
Still have the
QuoteThe SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
File: mywebsite/htdocs/newforum/Sources/BoardIndex.php
Line: 84
Ok,
So it didn't finish the conversion :| That column should of been dropped, and no messages should have an id of 0 nor topics. This would cause the indexes to not be created. Without these indexes the forum would be really slow.
Have you tried converting via command line? I am wondering if you have a server that just doesn't want to handle it via httpd because of apache timeouts. Using command line would avoid apache and let us just work straight with php.
How do I do it via the command line? From within PHPAdmin? What command do I make?
Quote from: vfrjon on August 27, 2008, 12:10:02 AM
How do I do it via the command line? From within PHPAdmin? What command do I make?
you need SSH- or telnet-access to the server for using the command line version..
QuoteSMF Command-line Converter
Usage: /path/to/php -f /path/to/smf/convert.php -- [OPTION]...
--path_to Path to SMF (/path/to/smf).
--path_from Path to the software that you are converting from.
--convert_script The name of the script. (old_forum_to_smf.sql)
--db_pass SMF database password. "The MySQL password (for verification only.)"
--debug Output debugging information.
From what I can see, No, I dont have access to SSH or telnet access on my webserver.
I do have an older version of phpadmin, appache, mysql etc locally that I used to develop the site originally (its largely database driven)
Perhaps I could backup the yabb forum and do it locally. Seems like a lot of up/downloading tho.
Any other way to do it?
Quote from: vfrjon on August 27, 2008, 01:35:50 AM
Perhaps I could backup the yabb forum and do it locally. Seems like a lot of up/downloading tho.
This would be the best option I think, because you can control all settings for MySQL/PHP and bypass all server based limits
OK, I now have phpmyadmin, MySql 5.0.51a, Apache 2.2.9 PHP 5.2.6 installed and configured locally.
I can view my website locally, and also the new SMF installation.
When I run the converter via the browser, I get the same results as when I ran it on the webserver.
I am going to try it via the command line, but am a little uncertain on where and what to type the command. Do I enter it directly into php.exe (it opens a cmd window when I run it)?
open a cmd window, then in the window run:
c:\php\php.exe -f c:\apache\htdocs\smf\convert.php....
i don't know the pathes from your local installed applications, this is only a short example how to call it on a windows system..
Thanks for your patience.
So I would use......
d:\server\php.exe -f d:\server\htdocs\newforum\convert.php --path_to=d:\server\htdocs\newforum --path_from=d:\server\htdocs\cgi-bin\yabb --convert_script=yabb21_to_smf.php --db_pass=password -- debug
Im at work at the present and cant check this for syntax.
Jon
Well Ive tried just about every combination of the syntax to try and run it locally via the command line and it does nothing.
All it returns is the syntax format that should be used!
More than happy to zip up the yabb files and email them to you to look at to see if you can convert them for me.
I'm starting to get emails from forum members missing the forum, so I really need to get this fixed.
the last one for debug shouldn't have a space between -- and debug.
It may be possible that the converter doesn't work for command line on windows, I think it was only tested on linux/unix machines. If that above change doesn't work, I can have you put in some debug code that will hopefully tell us.
Yeah, I worked that space out. I also tried it without it, and with out the debug command.
Open the convert.php
Find:
if (!isset($_SERVER['argv']))
$_SERVER['argv'] = array();
Add after:
print_r($_SERVER['argv']);
echo "\n\n\n";
Try to run it again, this time it should output some details before the message. Let me know this information.
Cant find that code in convert.php
Perhaps my problem is a wrong version of convert.php ????
I downloaded it with the converter package from the download page.
I have now downloaded the one from the sticky at the top of this forum, which is a different filesize, and does have that code.
I tried running it from the webserver and it ran through ok till cleaning up part 2 where it crashes due to the big selects error.
I will try it again locally tonight, as I can control the big_selects variable (default its on already), and I will also add the debug code.
Might be an idea to get the package on the download page checked.
After entering the code into convert.php , I tried to run it via the command line.
This is what I get.........
Quote
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
D:\>cd server\php
D:\server\php>php.exe -f D:\server\www\myserver.dev\public_html\htdocs\newforum\
convert.php --path_to=D:\server\www\myserver.dev\public_html\htdocs\newforum --p
ath_from=D:\server\www\myserver.dev\public_html\htdocs\cgi-bin\yabb --convert_sc
ript=yabb21_to_smf.php --db_pass=root --debug
Usage: php [options] [-f] <file> [--] [args...]
php [options] -r <code> [--] [args...]
php [options] [-B <begin_code>] -R <code> [-E <end_code>] [--] [args...]
php [options] [-B <begin_code>] -F <file> [-E <end_code>] [--] [args...]
php [options] -- [args...]
php [options] -a
-a Run interactively
-c <path>|<file> Look for php.ini file in this directory
-n No php.ini file will be used
-d foo[=bar] Define INI entry foo with value 'bar'
-e Generate extended information for debugger/profiler
-f <file> Parse and execute <file>.
-h This help
-i PHP information
-l Syntax check only (lint)
-m Show compiled in modules
-r <code> Run PHP <code> without using script tags <?..?>
-B <begin_code> Run PHP <begin_code> before processing input lines
-R <code> Run PHP <code> for every input line
-F <file> Parse and execute <file> for every input line
-E <end_code> Run PHP <end_code> after processing all input lines
-H Hide any passed arguments from external tools.
-s Display colour syntax highlighted source.
-v Version number
-w Display source with stripped comments and whitespace.
-z <file> Load Zend extension <file>.
args... Arguments passed to script. Use -- args when first argument
starts with - or script is read from stdin
--ini Show configuration file names
--rf <name> Show information about function <name>.
--rc <name> Show information about class <name>.
--re <name> Show information about extension <name>.
--ri <name> Show configuration for extension <name>.
D:\server\php>
try php.exe without -f and use the full path for --convert_script=
example:
--convert_script=D:\server\www\myserver.dev\public_html\htdocs\newforum\yabb21_to_smf.php
OK, without the -f and the script filename only has worked!
I added the debug code as advised, but did not see any output from that code.
I got a bunch of errors, all identical which I assume are related to the member records with no birthdays...........
PHP Notice: Undefined index: bday in D:\server\www\myserver.dev\public_html\ht
docs\newforum\yabb21_to_smf.php on line 333
Then it displays.....
Successful.
Successful.
Successful.
Successful.
. Successful.
... Successful.
...................................... Successful.
..... Successful.
..................... Successful.
........................ Successful.
..........
as its processing. Thats as far as it had got by the time I had to leave for work, so I will report back on the final results.
One thing I have noticed between doing the conversion on the webserver and doing it locally is the results in the database. As an example, running the conversion on the webserver, the dateRegistered column of the member table is filled out, yet on my local machine it doesnt, its filled with zeros ???
Well, its been running now for about 8 hours (via Command-line) and no sign of finishing.
CMD window shows pretty much the same as above,
The PHP warnings re undefined index, then
.Successful.
Successful.
Successful.
Successful.
. Successful.
............. Successful.
............................................................................ Successful.
................. Successful.
......................................................... Successful.
.............................................................................................. Successful.
............................................................................... {and continuing on next line}
.............................................................
The last line is increasing by one ' . ' about every 5 minutes.
Seems like this is taking an extraordinary long time to convert seeing it has 387 members, 13,189 posts, 1902 topics.
Should I let it keep running, or time to abort and add some debug code?
This is crazy!
Each time I run the convert process, I get a different result.
I cleared the forum tables, reinstalled and re-ran converter via command line. This time it made it all the way through, with a few errors.............
Quote
PHP Notice: Undefined index: bday in D:\server\www\myserver.dev\public_html\ht
docs\newforum\yabb21_to_smf.php on line 333
PHP Notice: Undefined index: bday in D:\server\www\myserver.dev\public_html\ht
docs\newforum\yabb21_to_smf.php on line 333
.
.
LOTS OF THESE
.
.
.
PHP Notice: Undefined index: bday in D:\server\www\myserver.dev\public_html\ht
docs\newforum\yabb21_to_smf.php on line 333
PHP Notice: Undefined index: bday in D:\server\www\myserver.dev\public_html\ht
docs\newforum\yabb21_to_smf.php on line 333
PHP Notice: Undefined index: bday in D:\server\www\myserver.dev\public_html\ht
docs\newforum\yabb21_to_smf.php on line 333
PHP Notice: Undefined index: bday in D:\server\www\myserver.dev\public_html\ht
docs\newforum\yabb21_to_smf.php on line 333
. Successful.
Successful.
Successful.
Successful.
Successful.
... Successful.
..... Successful.
... Successful.
PHP Warning: file(D:\\server\\www\\myserver.dev\\public_html\\htdocs\\cgi-bin\\
yabb/Messages/0.txt): failed to open stream: No such file or directory in D:\ser
ver\www\myserver.dev\public_html\htdocs\newforum\yabb21_to_smf.php on line 1193
........ Successful.
.. Successful.
.................................................... Successful.
Successful.
Successful.
. Successful.
Successful.
Successful.
Successful.
* Recalculating forum statistics... ..Unsuccessful! MySQL error message:
Duplicate entry '0' for key 1
Converting membergroups...Converting members...Converting settings...Converting
personal messages...Converting boards and categories...Converting mark read data
...Converting topics (part 1)...Converting topics (part 2)...Converting notifica
tions...Converting posts (part 1 - this may take some time)...Converting posts (
part 2)...Converting posts (part 3)...Converting attachments (if the mod is inst
alled)...Cleaning up (part 1)...Cleaning up (part 2)...Converting polls and poll
choices...Converting polls and poll choices (part 2)...Converting poll votes...
D:\server\php>
And now when I try and run new forum/index.php , I get a blank page. No source code, nothing.
The data base still contains similar data to what has been described earlier, with tempID still in the Topics table.
Attached are the convert and Yabbtosmf php files I used
and the command I made on the CLI is
d:\server\php\php.exe D:\server\www\myserver.dev\public_html\htdocs\newforum\convert.php --path_to=D:\server\www\myserver.dev\public_html\htdocs\newforum --path_from=D:\server\www\myserver.dev\public_html\htdocs\cgi-bin\yabb --convert_script=yabb21_to_smf.php --db_pass=root --debug
Give this yabb file a try.
QuoteD:\server\php>php.exe D:\server\www\myserver.dev\public_html\htdocs\newforum\con
vert.php --path_to=D:\server\www\myserver.dev\public_html\htdocs\newforum --path
_from=D:\server\www\myserver.dev\public_html\htdocs\cgi-bin\yabb --convert_scrip
t=yabb21_to_smf.php --db_pass=root --debug
PHP Notice: ob_end_clean(): failed to delete buffer. No buffer to delete. in D:
\server\www\myserver.dev\public_html\htdocs\newforum\convert.php on line 2519
Array
(
- => D:\server\www\myserver.dev\public_html\htdocs\newforum\convert.php
[1] => --path_to=D:\server\www\myserver.dev\public_html\htdocs\newforum
[2] => --path_from=D:\server\www\myserver.dev\public_html\htdocs\cgi-bin\yab
b
[3] => --convert_script=yabb21_to_smf.php
[4] => --db_pass=root
[5] => --debug
)
Converting membergroups.... Successful.
Converting members...PHP Notice: Undefined index: bday in D:\server\www\myserv
er.dev\public_html\htdocs\newforum\yabb21_to_smf.php on line 334
PHP Notice: Undefined index: bday in D:\server\www\myserver.dev\public_html\ht
docs\newforum\yabb21_to_smf.php on line 334
PHP Notice: Undefined index: bday in D:\server\www\myserver.dev\public_html\ht
docs\newforum\yabb21_to_smf.php on line 334
>>
>>
lots of these............
>>
>>
>>
PHP Notice: Undefined index: bday in D:\server\www\myserver.dev\public_html\ht
docs\newforum\yabb21_to_smf.php on line 334
PHP Notice: Undefined index: bday in D:\server\www\myserver.dev\public_html\ht
docs\newforum\yabb21_to_smf.php on line 334
PHP Notice: Undefined index: bday in D:\server\www\myserver.dev\public_html\ht
docs\newforum\yabb21_to_smf.php on line 334
PHP Notice: Undefined index: bday in D:\server\www\myserver.dev\public_html\ht
docs\newforum\yabb21_to_smf.php on line 334
PHP Notice: Undefined index: bday in D:\server\www\myserver.dev\public_html\ht
docs\newforum\yabb21_to_smf.php on line 334
PHP Notice: Undefined index: bday in D:\server\www\myserver.dev\public_html\ht
docs\newforum\yabb21_to_smf.php on line 334
. Successful.
Converting settings... Successful.
Converting personal messages.... Successful.
Converting boards and categories... Successful.
Converting mark read data.... Successful.
Converting topics (part 1).......... Successful.
Converting topics (part 2)........ Successful.
Converting notifications....... Successful.
Converting posts (part 1 - this may take some time)...PHP Warning: file(D:\\ser
ver\\www\\myserver.dev\\public_html\\htdocs\\cgi-bin\\yabb/Messages/0.txt): fail
ed to open stream: No such file or directory in D:\server\www\myserver.dev\publi
c_html\htdocs\newforum\yabb21_to_smf.php on line 1190
......... Successful.
Converting posts (part 2)..... Successful.
Converting posts (part 3).......................................................
.................................. Successful.
Converting attachments (if the mod is installed)... Successful.
Cleaning up (part 1)... Successful.
Cleaning up (part 2).... Successful.
Converting polls and poll choices... Successful.
Converting polls and poll choices (part 2)... Successful.
Converting poll votes... Successful.
* Recalculating forum statistics... ..Unsuccessful! MySQL error message:
Duplicate entry '0' for key 1
D:\server\php>
Sleepy, above are the results of the last convert with the file you supplied.
Well I can fix the bdary error easily :)
Does the forum run or work?
Does things work if you go to the Admin panel (will need to login) and then Forum Maintenance. Running the "Find and Repair Errors" and "Recount Totals and Stats" tools?
No, I cant get to the forum.
When I go to www.myserver.dev/public_html/htdocs/newforum/index.php I get a blank page. There is a pause while loading and looking at the 'page source' it displays no code. If I clear the tables, install the board again, it works with a new forum instal.
I imported the local database to the web based forum to see if I could access the forum. It worked.
When I log in, I get............
Quote
The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
File: mywebsite/newforum/Sources/BoardIndex.php
Line: 85
Running report errors, I get
Quote
The following errors are fouling up your forum:
Found topics and/or messages with topic or message IDs of 0.
Message #1 is in non-existent topic #1.
Message #1 is in non-existent topic #1.
Cached word 'smf' is linked to a non-existent topic.
Cached word 'to' is linked to a non-existent topic.
Cached word 'welcome' is linked to a non-existent topic.
Repair errors "YES"........
Quote
The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
File: mywebsite/htdocs/newforum/Sources/RepairBoards.php
Line: 173
smf_topics still contains data filled TempID
smf_members MemberID's are all still '0'
___________dateRegistered are all '0'
___________no PM infos
Would it be worth upgrading to Yabb2.2 and then converting that?
I am guessing that the topic ids and message ids didn't get linked up right or fixed correctly.
I need to think of an idea to fix this, I don't understand why it has worked so well in the past and then recently we have had all these issues just appear. I know the SMF database for 1.1 hasn't changed since it was released as final for 1.1.
Sleepy appreciate all your help,
Ive created a new Yabb2.2 board, and updated all the data from the old board to it, so I still have a working copy of yabb2.1 if required.
Ive tried converting yabb2.2 to SMF with the following error............
Quote
Quote
Converting membergroups... Successful.
Converting members...
Notice: Undefined index: bday in mywebsite/htdocs/newforum/yabb22_to_smf.php on line 333
Notice: Undefined index: bday in mywebsite/htdocs/newforum/yabb22_to_smf.php on line 333
Notice: Undefined index: bday in mywebsite/htdocs/newforum/yabb22_to_smf.php on line 333
Notice: Undefined index: bday in mywebsite/htdocs/newforum/yabb22_to_smf.php on line 333
(lots of these)
Notice: Undefined index: bday in mywebsite/htdocs/newforum/yabb22_to_smf.php on line 333
Successful.
Converting settings... Successful.
Converting personal messages...
Notice: Undefined offset: 7 in mywebsite/htdocs/newforum/yabb22_to_smf.php on line 485
Notice: Undefined offset: 7 in mywebsite/htdocs/newforum/yabb22_to_smf.php on line 492
Notice: Undefined offset: 7 in mywebsite/htdocs/newforum/yabb22_to_smf.php on line 485
Notice: Undefined offset: 6 in mywebsite/htdocs/newforum/yabb22_to_smf.php on line 491
(Lots of these)
Notice: Undefined offset: 7 in mywebsite/htdocs/newforum/yabb22_to_smf.php on line 492
Notice: Undefined offset: 7 in mywebsite/htdocs/newforum/yabb22_to_smf.php on line 485
Notice: Undefined offset: 6 in mywebsite/htdocs/newforum/yabb22_to_smf.php on line 491
Successful.
Converting boards and categories... Successful.
Converting mark read data... Incomplete.
Converting boards and categories... Successful.
Converting mark read data... Incomplete.
Converting topics (part 1)... Successful.
Converting topics (part 2)... Unsuccessful!
This query:
DELETE `vfr_smf_forum`.vfrforum_log_topics
WHERE ID_TOPIC = 2;
Caused the error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE ID_TOPIC = 2' at line 2
Looking at the tables on the db, it seems to have filled out a lot more info. For example, Members all have their own unique ID, Registration dates are filled in
Should we continue trying to convert 2.2 or go back to 2.1
I really need to get this board running.
yabb2.2tosmf.php and converter were downloaded from http://www.simplemachines.org/community/index.php?topic=249777.0
OK, that was an easy fix, should have been
DELETE FROM, not
DELETEConverter now finishes only displaying the errors as shown in above post about birthdays and undefined offset.
I can log in to the forum, topics and post are there but are showing as having no replies, altho they do display.
When I try to run fix and repair in maintanance, It reports errors about
Quote
Topic (numbers 1561 to 1900) contains no (actual) messages.
Topic #352 has the last message ID 12656, which is incorrect.
Topic #504 has the last message ID 11655, which is incorrect.
Topic #969 has the last message ID 11498, which is incorrect.
The subject of topic number 2 to 1460 is currently not stored in the subject cache.
Poll #1 has been given a vote from member #0 , who is now missing.
Trying to fix these, causes a long pause, then a blank screen, with
Quotehttp://www.myserver.dev/htdocs/newforum/index.php?action=repairboards;fixErrors;sesc=357ca78d2515cf88190ea0e5b1e49409
in the address abr of the browser.
Ran the converter again, and this time with another result............
SUCCESS!! Sort of........
It made it all the way through and when I went to Admin panel and ran "Find and fix errors", I got the expected BIG_SELECTS error, so I edited the sources/RepairBoards.php and with a bit of experimenting found where to place the " db_query("SET @@SQL_BIG_SELECTS = 1", __FILE__, __LINE__); "
Found and fixed all the errors and now the board appears to be running OK with all users and posts visable.
Only problem I can see so far is the PM's
The table on the data base (XXXX_personal_messages) is all screwed up
This is a sample of what it shows........
Quote
ID_PM ID_MEMBER_FROM deletedBySender fromName msgtime subject body temp_toName
1 0 1 Hey Hey :) 0 60.231.40.44 FlyGA
2 0 1 Hey Hey :) 0 210.10.229.143 thetonester
So obviously when you display the PM's the data doesnt relate to the corresponding column
Is there anyway to repair this, perhaps run only a section of the convert again to extract the correct data which can then be imprted to the database as I really dont want to have to run the complete convert again in case I dont get a happy result again.
Well, We can cut up the converter here most likely and try to have it just do pms since we have had luck so far.
It looks like the pm conversion is a little out of sync though for converting the data correctly.
Give this file a try, it will only convert pms. This is from the yabb22_to_smf.php file. Hopefully it is converting the pms correctly. If it isn't, then I might need a another sample pm file to make sure I am reading the text file right.
Thanks!
Running this script, I get this.......
Quote
Notice: Undefined offset: 7 in mywebsite/forum/yabb22-pms_to_smf.php on line 162
Notice: Undefined offset: 7 in mywebsite/forum/yabb22-pms_to_smf.php on line 169
Notice: Undefined offset: 7 in mywebsite/forum/yabb22-pms_to_smf.php on line 162
Notice: Undefined offset: 7 in mywebsite/forum/yabb22-pms_to_smf.php on line 169
Notice: Undefined offset: 7 in mywebsite/forum/yabb22-pms_to_smf.php on line 162
Notice: Undefined offset: 7 in mywebsite/forum/yabb22-pms_to_smf.php on line 169
Successful.
Recalculating forum statistics... Unsuccessful!
This query:
SELECT t.ID_TOPIC, COUNT(m.ID_MSG) AS numMsg
FROM `vfr_smf_forum`.vfrforum_topics AS t
LEFT JOIN `vfr_smf_forum`.vfrforum_messages AS m ON (m.ID_TOPIC = t.ID_TOPIC)
GROUP BY t.ID_TOPIC
HAVING numMsg = 0
LIMIT 0, 200;
Caused the error:
The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
Big_Selects is not a major issue, I just need to find where to shove the " db_query("SET @@SQL_BIG_SELECTS = 1", __FILE__, __LINE__); " like I did in the RepairBoards.php (Or perhaps you could tell me ;) ) Either that or I run repair / recount etc from Admin.
Its partially worked............
I have PMs in my inbox, same number as in YABB.
Looking at my .msg file in YABB,
Quote1198758920|rpleum|jon|||Circuit|1198758919|Hi,<br /><br />Could you send the electronic circuit with all the IC's to [email protected]?<br />thanks a lot! ;D|1198758920|0|77.249.185.230|s|r||
Nothing in my Outbox
Looking at my .outbox file in YABB,
Quote1198808115|jon|rpleum|||Re: Circuit|1198808114|Sure, I think I have one I drew that starts at the USB input, and goes thru to the 40 outputs to the matrix. Its on a hard drive at home, so I will dig it up and post it on the forum. <br /><br />Ive decided to create a new forum for Hardware (at present its hidden whilst in developement) but should be up soon.<br /><br />Jon|1198808115|0|124.186.41.133|s|||
Looking at another members .msg file in YABB,
Quotejon|Re: Westsim|1179141939|Thanks Josh|1179141941|211.26.76.166
Looking at same members .outbox file in YABB,
Quotejoshstone|hi|1198413076|hi|1198413077|121.221.193.9|1
So it seems there are 2 file formats in the folder.
Bear in mind that I have just converted from YABB2.1 to YABB2.2 but just copied the Members and Messages folders to the new install. Im going crazy trying to work out what happens here, which is why I have edited this post so many times! Perhaps the 2 versions of YABB use different formats, and it converts them the first time you access them in YABB2.2.............
temp_toName still contains data in the
XXX_personal_Messages tableand the rest of the data is all out of order
The First 430 or so are like this
Quote
ID_PM ID_MEMBER_FROM deletedBySender fromName msgtime subject body temp_toName
93 0 1 Re: Westsim 0 211.26.76.166 joshstone
The rest (about a 60) or so are like this. They are all mine, which leads me believe that they ARE being changed by YABB as these files were placed into the directory from a backup tonight.
Quote
ID_PM ID_MEMBER_FROM deletedBySender fromName msgtime subject body temp_toName
496 313 1 rpleum 1198758919 Circuit Hi,<br /><br />Could you send the electronic circu... jon
The forum is locked, so I am the only one who has been there, and I have checked my PM's in YABB. I will go and compare the files from the backup.................
My backup from the YABB2.1 board has this format
Member|subject|timestamp|body|another timestamp|IP AddressAnd the same file from YABB2.2 has this format
Timestamp|Member(Author)|Member(recipient)|another timestamp|body|another timestamp|IP Address||(s)|(r)|(null)|(null)]
They may not be timestamps, they may be post references. Not sure what they are, but I guess you will :D
I had a look at the outbox folders and they too change with the YABB update in the same way.
Perhaps the converter needs to look at the data, decide what format it is in, then process it accordingly.
More than happy to zip up and email some of the complete files (.outbox .msg .ims etc) of a couple of members for you to look at, just let me know which ones you want. Or, I could give you ftp access to the YABB folder on the server.
Jon
Ok, those to formats wont make the flat file conversion very easy to do :(
That will be a pain to even work with really.
Some of those messages don't even have the no smiley information (the new one may have it in |s|).
The only way It may work is if we can detect the pm formats.
Are the PMs this important? It sounds like you have everything else. Is it going to be worth it to try and dig this around with these two formats to get the pms converted?
I was wondering if it would be easier for me to restore the data files from the earlier version (The one that starts with the member name and try and convert those as they 'should' all be the same format.) My members have been advised that any PM's they may send in the short term may be lost, but I would like to retrieve them and have the conversion complete.
I may be wrong, but detecting the PM format would be easy wouldnt it? First field a number or a word??
Also, if my assumtions are correct in the fact that the format changes with a YABB upgrade, then this may cause problems for others converting to SMF. If another board has gone through the same upgrade process Yabb1 to Yabb 2.1 to Yabb 2.2 then some of the PM's in their files are likely to have different formats also.
What about the outbox issue being empty? Any ideas there?
Jon
Well the only problem with detecting the format is knowing what to detect and knowing what order the information is in. I see from your example of another members .msg file, there is no information about using smiles or not. I see the username, I see the ip, subject and body. There is two timestamps but I am not sure which one is the right one to use.
This gets to be the pain really for converting anything from flat file. :P
I heard btw that Yabb 2.2 supports MySQL? Do they have a converter to go to MySQL? I wonder about maybe using that tool to simply things.
I think YABB3 has SQL support, but as its in Alpha, there does not appear to be a download. Package claims it will have a converter tho, but not due for release till later this year.
Looking at a post in both formats of the .msg file, The extra timestamp is only 1 (second? or millisecond?) different, but the current converter actually converts these messages correctly.
This one from the old format,
QuoteLiquid|hey mate|1202467792|Hi mate, .....(content edited out).....take care mate..<br /><br />Lance|1202467793|124.185.36.137
and from the new (same message) which works, with the current converter
Quote1202467793|Liquid|jon|||hey mate|1202467792|Hi mate, .....(content edited out).......<br /><br />Lance|1202467793|0|124.185.36.137|s|||
Would it be possible to make a converter that deals with the old format ? I will then put my original .msg file back so they are uniform.
Any idea why none of the sent ones convert? (The ones in the .outbox file)
Jon
The converter doesn't currently support getting ones from the outbox, I haven't had much time to digg into this, it would be a complicated process to do this as the converter basically may have to do it in a second step and see if it exists in the database first and if it does update the pm info in the database to let it know the sender has not deleted the pm.
Give this file a try though. I think I made it support both formats with a quick numeric check on the first item in the array to see if its numeric or not.
getting......
Quote
Notice: Undefined index: formName in mywebsite/forum/yabb22-pms_to_smf.php on line 188
Notice: Undefined index: in mywebsite/forum/yabb22-pms_to_smf.php on line 188
.
.
lots of these! Too many to count ;)
.
.
Notice: Undefined index: formName in mywebsite/forum/yabb22-pms_to_smf.php on line 188
Notice: Undefined index: in mywebsite/forum/yabb22-pms_to_smf.php on line 188
Then the big sql error
Database has no "from name" on any of the rows. Nor do my PM's state who they are from. These could be populated from the .msg filename perhaps? Other than that it looks good.
I'll look at the .outbox files and do some experimenting. I have a feeling they get a flag added when deleted........
Ahh looks like a typo. formname should be fromname
I read post after I sent it and saw that.
Going to fix it and rerun it.........
Yeah that was it.
Got froms in messages and in all database records now.
Still getting
QuoteNotice: Undefined offset: 7 in mywebsite/forum/yabb22-pms_to_smf.php on line 182
on quite a few lines still. Is this an issue?
Also TempToName is still in table.
Jon
Would be good to get the ones from the outbox tho, even if means that members have to delete them again.
Would make the convert complete
Those errors shouldn't cause an issue, but I fixed them just in case.
Sleepy,
That file gives an error about unexpected t variable on line 182. Cant remember the exact wording.
But its OK, I have the inboxes populated with all the correct data, and I played around with the file that achieved this and had it work on the .outbox files
I changed the following.....
Quoteif (strrchr($entry, '.') != '.outbox')
continue;
$userData = file($yabb['memberdir'] . '/' . $entry);
foreach ($userData as $i => $v)
{
$userData[$i] = explode('|', rtrim($userData[$i]));
if (count($userData[$i]) <= 2 || empty($userData[$i]))
continue;
// Figure out the format.
$use = 'old';
if (is_numeric($userData[$i][0]))
$use = 'new';
if ($use == 'old' && substr($userData[$i][7], -10) == '#nosmileys')
$userData[$i][7] = substr($userData[$i][7], 0, -10);
elseif ($use == 'new' && $userData[$i][11] == 's')
$userData[$i][11] = $userData[$i][11];
$row = array(
'temp_toName' => substr(htmlspecialchars($userData[$i][$format[$use]['fromName']]), 0, 255),
'subject' => substr($userData[$i][$format[$use]['subject']], 0, 255),
'msgtime' => !empty($userData[$i][$format[$use]['msgtime']]) ? (int) $userData[$i][$format[$use]['msgtime']] : '0',
'body' => substr($userData[$i][$format[$use]['body']], 0, 65534),
'ID_MEMBER_FROM' => 0,
'deletedBySender' => 0,
'fromName' => htmlspecialchars(substr($entry, 0, -7)),
);
So, now I have inbox and outbox populated with what I can see is the correct data. Of course the sent PM's that had been deleted by the sender are back in their outbox, but I dont see that as a big issue, they can delete them again.
temp_toName is still in the _personal_messages table
Is it OK to drop this column now?
I
think my conversion is complete. YAY!
If everything is completed and working fine then you can.
OK, Ill drop that column.
Thanks again for all your assistance with this.
You are welcome
I would suggest though, make a backup of your new SMF database, and then download the one of the upgrade packages for the version of SMF you are using (I assume 1.1). Then just upload the upgrade.php and the two sql scripts.
This will hopefully go through and fix any issues that the conversion might of created and add back any missing indexes hopefully.