Discus 4 --> phpBB2 convertor

This is an archive of the phpBB 2.0.x convertors forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
markus_freerela
Registered User
Posts: 67
Joined: Sat Mar 03, 2007 5:33 pm

Re: Discus 4 --> phpBB2 convertor

Post by markus_freerela » Mon Aug 20, 2007 3:43 am

you have to insert debug statements into the code so you know what currently happens. Such as: uncomment line 833:

Code: Select all

//print "sql=$sql <br>\n"; 
write:

Code: Select all

print "sql=$sql <br>\n"; do_flush();
. Then you know how long it takes to fetch the first record. If you like, you may add more print statements, so you know where the code currently is. You may also copy the statement "

Code: Select all

explain select l.*,pm.posttopic,pm.postpage,tr.parent,tr.mode,tr.title from discus_log_sorted l, discus_postmap pm, discus_trees tr where l.postnum=pm.postnum and pm.postpage=tr.pagenum LIMIT 0,5000
" into your mySQL control panel and check whether the indexes are taken into account.

hal65
Registered User
Posts: 9
Joined: Fri Aug 17, 2007 10:45 am

Re: Discus 4 --> phpBB2 convertor

Post by hal65 » Mon Aug 20, 2007 10:11 am

:cry: doesn't work.

Also with the limit of 100 posts it halts at the same place, I see these rows then nothing else.

Code: Select all

migrating approx. 53946 posts...
sql=select l.*,pm.posttopic,pm.postpage,tr.parent,tr.mode,tr.title from discus_log_sorted l, discus_postmap pm, discus_trees tr where l.postnum=pm.postnum and pm.postpage=tr.pagenum LIMIT 0,5000 

migrating approx. 53946 posts...
sql=select l.*,pm.posttopic,pm.postpage,tr.parent,tr.mode,tr.title from discus_log_sorted l, discus_postmap pm, discus_trees tr where l.postnum=pm.postnum and pm.postpage=tr.pagenum LIMIT 0,100 

Code: Select all

id  select_type  table  type  possible_keys  key  key_len  ref  rows  Extra  
1 SIMPLE l ALL PRIMARY NULL NULL NULL 53946   
1 SIMPLE pm eq_ref PRIMARY PRIMARY 4 forum_3.l.postnum 1   
1 SIMPLE tr eq_ref PRIMARY PRIMARY 4 forum_3.pm.postpage 1   
Little dubt, are there problems if the Discus db is different from the phpBB one ?

I have discus on forum_1 and phpbb on forum_3, same server, same user.

Thanks for your help !

markus_freerela
Registered User
Posts: 67
Joined: Sat Mar 03, 2007 5:33 pm

Re: Discus 4 --> phpBB2 convertor

Post by markus_freerela » Mon Aug 20, 2007 2:07 pm

I assume the discus data is messed up in some old records which might result in an endless loop and thus result in a memory usage going out of the roof. It would also explain why other users (incl myself) haven't run into this kind of problem yet.

Please check whether you have any problem records by running this SQL statement from your MySQL console:

Code: Select all

SELECT * FROM discus_trees WHERE pagenum=parent
. This statement should NOT return any rows; otherwise there's something wrong with the way discus stored the tree data.

Should you see any rows, please go to line 897 starting with:

Code: Select all

if ($db -> sql_numrows($res3) > 0 && $parent2 != 0) {
and surround this statement block with following IF-block:

Code: Select all

						if ($parent == $parent2) {
							// prevent endless loop
							$sql = "select phpbb_forum_id from discus_migr_topics where discus_topic_id=$dpage";
							$res3 = $db -> sql_query($sql);
							$forumid = $row3['phpbb_forum_id'];
							$db -> sql_freeresult($res3);
							break;
						} else {
							if ($db -> sql_numrows($res3) > 0 && $parent2 != 0) {
								$sql = "select phpbb_forum_id from discus_migr_topics where discus_topic_id=$parent2";
								$res3 = $db -> sql_query($sql);
								$row3 = $db -> sql_fetchrow($res3);
								$forumid = $row3['phpbb_forum_id'];
							} else {
								break;
							}
						}
Maybe this helps. No other idea as of yet. But the previous change was necessary also....

damian.bunn
Registered User
Posts: 6
Joined: Sun Aug 26, 2007 5:29 pm

Re: Discus 4 --> phpBB2 convertor

Post by damian.bunn » Sun Aug 26, 2007 6:33 pm

I have tried using the script and it gets so far and stops:

migrating log-file /data01/myninety/public_html/discus_admin_1567811543/msg_index/1558-log.txt
migrating log-file /data01/myninety/public_html/discus_admin_1567811543/msg_index/1559-log.txt
migrating log-file /data01/myninety/public_html/discus_admin_1567811543/msg_index/3306-log.txt
migrating log-file /data01/myninety/public_html/discus_admin_1567811543/msg_index/1582-log.txt
migrating log-file /data01/myninety/public_html/discus_admin_1567811543/msg

Any clues what could be causing this ?

Damian

markus_freerela
Registered User
Posts: 67
Joined: Sat Mar 03, 2007 5:33 pm

Re: Discus 4 --> phpBB2 convertor

Post by markus_freerela » Mon Aug 27, 2007 3:50 am

Seems like the output is cached on server side and only released to screen every n bytes.... I've just now released a version that should handle output better. I don't know which version you're trying it with. If one doesn't work, check whether I uploaded a new one. You can also help by building new print statements into the code so we can better track. I believe the current version works (at least it does for me), so I won't work on it anymore for some time unless there are big provable faults.

damian.bunn
Registered User
Posts: 6
Joined: Sun Aug 26, 2007 5:29 pm

Re: Discus 4 --> phpBB2 convertor

Post by damian.bunn » Mon Aug 27, 2007 10:49 am

Marcus,

Thanks for the quick response. That has got me further. I was using Version 2.0 of the script and now have 2.0.2

The posts unfortunately are being posted as Topics with empty content. Take a look at the test forum and you will see what I mean. http://www.my90.co.uk/www.lpgforum.co.uk

Damian

markus_freerela
Registered User
Posts: 67
Joined: Sat Mar 03, 2007 5:33 pm

Re: Discus 4 --> phpBB2 convertor

Post by markus_freerela » Thu Aug 30, 2007 3:31 am

What did YOU do after the script ran? Have you deleted the user accounts created by the script? phpBB won't display topics if no matching user accounts were found.... The script also creates account with id = 0.Do not delete this one either! Also, do not delete the account with id = -1 (anonymous account) that comes with your phpBB installation. In other words: Do not delete user accounts created by the script !!

markus_freerela
Registered User
Posts: 67
Joined: Sat Mar 03, 2007 5:33 pm

Re: Discus 4 --> phpBB2 convertor

Post by markus_freerela » Sat Sep 08, 2007 5:47 pm

I've just released a new version, 2.0.4.0 of the script. It'll tell for instance when an insert is not possible (because e.g. the db structure was changed and doesn't correspond to the standard phpBB 2.0.x installation anymore). I also worked on the performance. It now runs 2 - 3 times as fast as any previous version. It's still available for free from http://www.discusscripts.com/downloads/discus_migr.zip

In case of any errors, I need the full screen output and the version #.
Deeper analysis is subject to payment of a donation of US$ 30.00 under http://order.kagi.com/?4NK&S&lang=en

damian.bunn
Registered User
Posts: 6
Joined: Sun Aug 26, 2007 5:29 pm

Re: Discus 4 --> phpBB2 convertor

Post by damian.bunn » Mon Sep 10, 2007 11:50 am

I am still having trouble running the script. I am more than happy to make a donation. What is the process, should I send the money now or later.

I run the script on a brand new, fresh install of phpBB 2.022 and get the following errors:-

optimizing tables ... done!
preparing database...

SQL-Warning!
SQL=DELETE FROM phpbb_posts_text WHERE post_id IN(select phpbb_post_id FROM discus_migr_posts)
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 'select phpbb_post_id FROM discus_migr_posts)' at line 1
source-line=238


SQL-Warning!
SQL=DELETE FROM phpbb_posts WHERE post_id IN(select phpbb_post_id FROM discus_migr_posts)
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 'select phpbb_post_id FROM discus_migr_posts)' at line 1
source-line=240


SQL-Warning!
SQL=DELETE FROM phpbb_topics WHERE forum_id in (select phpbb_forum_id from discus_migr_topics)
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 'select phpbb_forum_id from discus_migr_topics)' at line 1
source-line=241


SQL-Warning!
SQL=DELETE FROM phpbb_forums WHERE forum_id in (select phpbb_forum_id from discus_migr_topics)
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 'select phpbb_forum_id from discus_migr_topics)' at line 1
source-line=242


SQL-Warning!
SQL=DELETE FROM phpbb_auth_access WHERE forum_id in (select phpbb_forum_id from discus_migr_topics)
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 'select phpbb_forum_id from discus_migr_topics)' at line 1
source-line=243


SQL-Warning!
SQL=DELETE FROM phpbb_categories WHERE cat_id in (select phpbb_cat_id from discus_migr_topics)
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 'select phpbb_cat_id from discus_migr_topics)' at line 1
source-line=244


Can't clean posts table
SQL=delete from phpbb_posts where poster_id not in (select user_id from phpbb_users)
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 'select user_id from phpbb_users)' at line 1
source-line=261


Can't clean posts_text table
SQL=delete from phpbb_posts_text where post_id not in (select post_id from phpbb_posts)
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 'select post_id from phpbb_posts)' at line 1
source-line=262


Can't clean topics table
SQL=delete from phpbb_topics where topic_id not in (select topic_id from phpbb_posts)
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 'select topic_id from phpbb_posts)' at line 1
source-line=263

optimizing tables ... done!


Migrating Users...
reading user data from file


Cannot write into discus_users table
SQL=INSERT INTO discus_users(user,salt,ctime,is_mod) VALUES ('admin','JE',1152445251,0)
Error=Duplicate entry 'admin' for key 1
source-line=421

markus_freerela
Registered User
Posts: 67
Joined: Sat Mar 03, 2007 5:33 pm

Re: Discus 4 --> phpBB2 convertor

Post by markus_freerela » Mon Sep 10, 2007 4:18 pm

What version of MySQL are you on? The statments have been tested on a 4.1.21 database. They likely won't run on an 3.x or 4.0 database. Regarding the last statement: Truncate discus_users table ('truncate table discus_users' or 'delete from discus_users'). Since also 4.1 is out of lifecycle now, you should ask your provider for an upgrade if you're on an old version.

markus_freerela
Registered User
Posts: 67
Joined: Sat Mar 03, 2007 5:33 pm

Re: Discus 4 --> phpBB2 convertor

Post by markus_freerela » Mon Sep 10, 2007 4:32 pm

Re the duplicate key in discus_users: You should make sure you don't have duplicate user-names in discus tables "_passwd" and "_users" if you use the Discus MySQL backend and in files "passwd.txt" and "users.txt" in your discus admin directory if you don't use the MySQL backend. It seems as though user "admin" is present in "passwd" AND "users" file / table. Delete it from passwd.txt / passwd table because it's likely a moderator account. There might potentially more accounts with same name present in those files / tables. Please verify and clean them out before running the script again.

damian.bunn
Registered User
Posts: 6
Joined: Sun Aug 26, 2007 5:29 pm

Re: Discus 4 --> phpBB2 convertor

Post by damian.bunn » Mon Sep 10, 2007 6:02 pm

I have chedked the SQL version, it is "Server version: 4.0.27-standard-log". I will contact my ISP and see if I can get an upgrade.

As to the users I remove a user account and it fails on the next one and so on. So from what you are saying it looks like a fundamental SQL problem :(

Have you changed the script much as an earlier version I used ran OK

Rgds

Damian

markus_freerela
Registered User
Posts: 67
Joined: Sat Mar 03, 2007 5:33 pm

Re: Discus 4 --> phpBB2 convertor

Post by markus_freerela » Tue Sep 11, 2007 3:45 am

You may believe me, the script has been tested hundreds of times on my own server, there's no fundamental SQL problem. Should there have been any in the past, they've been resolved. Re the duplicate key problem: Please read my previous answer: truncate the discus_users table or drop that table manually, it'll be re-created! Otherwise, you have to compare the records one by one. Yes, the script has been changed significantly compared to previous versions. While previous versions trusted on old data to be clean and phpBB structure not being changed (= gently ignoring SQL errors), the current one now makes a mess in the data very obvious.

damian.bunn
Registered User
Posts: 6
Joined: Sun Aug 26, 2007 5:29 pm

Re: Discus 4 --> phpBB2 convertor

Post by damian.bunn » Tue Sep 11, 2007 4:36 am

Sorry I did not explain myself very well, when I said SQL error I meant with my install and version and was not implying your script.

I will get our SQL guys to have a look at the syntax today see if I can work around for an earlier version of MySQL. I contacted my ISP. I do not think they will upgrade :(

Thanks for your responses

Damian

damian.bunn
Registered User
Posts: 6
Joined: Sun Aug 26, 2007 5:29 pm

Re: Discus 4 --> phpBB2 convertor

Post by damian.bunn » Thu Sep 13, 2007 11:46 am

My ISP has migrated me across to SQL 4.1 now, very nice people and I get further in that I do not get the SQL errors. I do however get erros when trying to import the user accounts.

Cannot write into users table
SQL=INSERT INTO phpbb_users(user_id,username,user_password,user_regdate,user_email,user_level,user_style,user_lang,user_avatar) VALUES (100,'steve','WYfKMw7usnRnY',990781523,'steve@demon.com',0,1,'english','')
Error=Duplicate entry '100' for key 1
source-line=429

I went through and emptied all of the relevent tables in PHPBB prior to running the conversion. Any tips would be gratefully accepted.

Rgds

Damian

Locked

Return to “[2.0.x] Convertors”