News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Import phpbb

Started by FixItMan, August 23, 2004, 05:37:47 AM

Previous topic - Next topic

FixItMan

Hi All

Is there a way to import a phpbb database into SMF.

Manythanks
Paul

David

This space for rent.

FixItMan


Abedie

Hi,

I got this errors (many) while converting:
Converting members...
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/tocai/domains/tocai-ananda.org/public_html/phpbb2_to_smf.php on line 287

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/tocai/domains/tocai-ananda.org/public_html/phpbb2_to_smf.php on line 302
successful.

The list is longer but this are the two sorts of errors I get about ten times.
I work with phpBB version 2.0.10 and convert to smf rc1.
My MySQL ofthen seems to act strange when there are no '  around the fieldnames. Could that be the problem here?
Any ideas?
Greatfull for you're help,

Abedie

The list about Galery/CMS/Portal using SMF



A dark spot in the light is nearly seen, but a light in the darkness is seen miles away.
Try to be that light for others.

packman

Based on domain name I suspect your database may have a '-' in it? The dash, and many other characters, is only allowed in database, table and field names if included in a quote delimited string. The converter doesn't include these quotes (and neither does the updated converter due for release with RC2) and that is almost certainly why other tools give errors when you miss out the quotes.

I think you've got three options...

1) Can you rename your database to use '_' rather than '-'? The converter should then run without problems. You'll have to change your phpBB config file to point at the renamed database (along with any other software that accesses the database). This may not be easy (if you rely on a shared hosting company to set up databases for you) or if you have a lot of software accessing the database.

2) Modify the current converter to include quotes round all the database/table/field references.

3) Wait until the updated converter is modified to include quotes round all the database/table/field. This assumes that the converted can be modded and tested before RC2 hits the streets.

I don't know when RC2 is due for release, but the updated converter migrates a lot more phpBB data across to SMF than the current converter, so you might prefer to wait to do your migration until it's released.
Chris

Abedie

#5
Thank you very much for you're reply, that was very quick :).

The only character I use with names of DB's is the '_'. The domain has a '-' in it but the username not.
Can you please give me an example how I addapt the script so that there are ' .... ' around fieldnames as MySQL asked for those from the beginning and is set to do that, whatever there is in the fieldnames. I have access to the dbases by phpmyadmin and can create them myself.

Thanks again :),

Abedie

The list about Galery/CMS/Portal using SMF



A dark spot in the light is nearly seen, but a light in the darkness is seen miles away.
Try to be that light for others.

packman

I'm not sure why you'd need quotes round all the database/table/field names. alphanumeric characters plus _ and $ are always allowed. From v3.23.6 you could add quotes to allow other characters to be used, as well as creating fully numeric names and names containing reserved words. What is your database name and what is the phpBB2 table prefix string and do they have any unusual characters or reserved words in them?

Chris

Abedie

The dbname is 'tocai_sts'.  The prefix = 'phpbb_' the standard given. I use MySQL 4.0.17.
So nothing strange.

Thanks again :).
Abedie

The list about Galery/CMS/Portal using SMF



A dark spot in the light is nearly seen, but a light in the darkness is seen miles away.
Try to be that light for others.

packman

I had to go do some DIY :(

I can't think why you need quotes round all the fields. There doesn't seem to be anything unusual in your naming convention. Can you run the converter again and count exactly how many times you get the errors. I think you might get 11. If you can also note down what is being converted at the time that will help narrow down the source of the problem.

I have to go to eat now. I'll check back in later on this evening to see if I can work out what's going wrong for you.
Chris

Abedie

#9
Thank you very much!

Here's the error report:
Converting...
Converting members...
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/tocai/domains/tocai-ananda.org/public_html/phpbb2_to_smf.php on line 287

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/tocai/domains/tocai-ananda.org/public_html/phpbb2_to_smf.php on line 302
successful.
Converting categories...
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/tocai/domains/tocai-ananda.org/public_html/phpbb2_to_smf.php on line 407

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/tocai/domains/tocai-ananda.org/public_html/phpbb2_to_smf.php on line 417
successful.
Converting boards...
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/tocai/domains/tocai-ananda.org/public_html/phpbb2_to_smf.php on line 498

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/tocai/domains/tocai-ananda.org/public_html/phpbb2_to_smf.php on line 508
successful.
Converting topics...
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/tocai/domains/tocai-ananda.org/public_html/phpbb2_to_smf.php on line 592

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/tocai/domains/tocai-ananda.org/public_html/phpbb2_to_smf.php on line 602
successful.
Converting messages... (this may take some time)
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/tocai/domains/tocai-ananda.org/public_html/phpbb2_to_smf.php on line 696

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/tocai/domains/tocai-ananda.org/public_html/phpbb2_to_smf.php on line 706
successful.
Converting polls...
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/tocai/domains/tocai-ananda.org/public_html/phpbb2_to_smf.php on line 782

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/tocai/domains/tocai-ananda.org/public_html/phpbb2_to_smf.php on line 792
successful.
Converting poll options...
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/tocai/domains/tocai-ananda.org/public_html/phpbb2_to_smf.php on line 862

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/tocai/domains/tocai-ananda.org/public_html/phpbb2_to_smf.php on line 872
successful.
Converting previous poll votes...
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/tocai/domains/tocai-ananda.org/public_html/phpbb2_to_smf.php on line 941

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/tocai/domains/tocai-ananda.org/public_html/phpbb2_to_smf.php on line 951
successful.
Converting personal messages...
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/tocai/domains/tocai-ananda.org/public_html/phpbb2_to_smf.php on line 1026

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/tocai/domains/tocai-ananda.org/public_html/phpbb2_to_smf.php on line 1036
successful.
Converting personal messages (step 2)...
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/tocai/domains/tocai-ananda.org/public_html/phpbb2_to_smf.php on line 1105

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/tocai/domains/tocai-ananda.org/public_html/phpbb2_to_smf.php on line 1115
successful.
Converting topic notifications...
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/tocai/domains/tocai-ananda.org/public_html/phpbb2_to_smf.php on line 1185

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/tocai/domains/tocai-ananda.org/public_html/phpbb2_to_smf.php on line 1195
successful.
Converting board access... successful.
Converting smileys... successful.
Recalculating forum statistics... successful.

As you see it's a pair of fetch and row error's that repeat itself when a new part is converted, like members, catagory etc.
Hmm, can't be that big as it apears just ones per part and it shows the other things are working fine.
I was switched to phpBB because Invision got commercial and I found this board to late for our organisation. Could be wise if everybody uses the same forumscript (smf) so we have for the last time these convert problems ;).
Have a fine meal and some rest :)
Thank you very much from this side of the world.

Abedie.

The list about Galery/CMS/Portal using SMF



A dark spot in the light is nearly seen, but a light in the darkness is seen miles away.
Try to be that light for others.

packman

The error log means that my hunch is probably right about the code construct that's causing the problem. I'm not sure how to fix the problem at the moment, but I'll look into it this evening.
Chris

[Unknown]

Actually, the converters should work with dashes, etc.  They do this:

`databasename`.tablename.columnname.

This means it's okay to have dashes, underscores, and even other characters in your database name.  There need not be ticks around fields or tables, unless your prefix has strange characters in it (and I personally think them ricks are UGLY.)

The errors may be seen by adding "or die(mysql_error())" on the end of a query.... but, I think I know the problem...

Code construct?  I don't know what you mean.

Abedie, are you running the converter between two different databases?  Have you checked that the users can access each other's databases?

-[Unknown]

packman

The errors occur in 11 step routines. The only step routines that fail all contain code which converts a table into a SELECT string and the invalid query result errors occur when string is used. So it's fairly likely that the error is related to code constructs like...

$categories_table = array(
'ID_CAT' => 'cat_id',
'name' => 'cat_title',
'catOrder' => 'cat_order',
'canCollapse' => '',
);


...and/or the code that turns that table into the SELECT string.

Having said that I can't work out why it's failing in this case yet. If the database normall needs ticks then it suggests that something in the database, table or field names contains unusual characters. However, there is no evidence of anything odd in the naming conventions used. There are also other SELECT statments used (without the table to string conversion stuff) which don't appear to be failing which is at odds with the tick theory.
Chris

[Unknown]

Again, here's what's happening:

SELECT column
FROM database1.table1;
--> MySQL ERROR: User "database2user" doesn't have access to database1!! EVIL HACKER GO AWAY!!!

INSERT INTO database2.table1
   (column)
VALUES ('oops didn\'t get them!');
--> OK.

It has nothing to do with ticks.  It's happening only for those queries that try to access the phpBB database.

-[Unknown]

packman

I suspect you're right  :D

In my defence ;) I'll say that the routines that build a SELECT string also happen to be the only routines that access the phpBB database. I was thinking about the latest converter which has routines that access the phpBB database without building a SELECT string first. I assumed that other queries (actually non-existent in this version) were successfully accessing the DB.
Chris

Abedie

#15
Hi,

First thanks for you're efforts to try to solve this.

Thinking outloud:
1. The phpBB2 dbase is still in use, using the details that are in the settings in config.php, the same details the convertor is pointed too. It's checked by the converter before the conversion started.
If the phpBB2 forum works with those details the access with the given details should be ok, so why should they fail to work, only when the converter is working?
2. I created the account for this domain (tocai-ananda.org) and the database for phpBB2. When I wanted to switch to SMF, I installed it in a new subdir (forums) and created a dbase in the same account, having the situation of two MySQL dbases under the same domain on the same webspace. The names are 'tocai_sts' and 'tocai_smf', both working fine.
3. As the two forums do working fine, there's no reason to think of characters that won't be accepted by the server, as they should not be in there if that was the case.

Question: Could it be that the server refuses a second connection at the same time from the same IP, as first the 'tocai_smf' dbase is opened and then the phpBB2 dbase seems to fail as I read it in you're stories?

Thanks again,
Abedie

(I will check the users question you asked)

The list about Galery/CMS/Portal using SMF



A dark spot in the light is nearly seen, but a light in the darkness is seen miles away.
Try to be that light for others.

[Unknown]

Quote from: Abedie on September 26, 2004, 06:38:45 PM
Hi,

First thanks for you're efforts to try to solve this.

Thinking outloud:
1. The phpBB2 dbase is still in use, using the details that are in the settings in config.php, the same details the convertor is pointed too. It's checked by the converter before the conversion started.
If the phpBB2 forum works with those details the access with the given details should be ok, so why should they fail to work, only when the converter is working?

The converter only uses one account - the SMF one.  That means the SMF user must be able to access both the SMF tables *and* the phpBB ones.

Quote
2. I created the account for this domain (tocai-ananda.org) and the database for phpBB2. When I wanted to switch to SMF, I installed it in a new subdir (forums) and created a dbase in the same account, having the situation of two MySQL dbases under the same domain on the same webspace. The names are 'tocai_sts' and 'tocai_smf', both working fine.

Why not install SMF in the same database as phpBB, with the same user?  Or if not that, how about in a different database, but with the same user?

Quote
3. As the two forums do working fine, there's no reason to think of characters that won't be accepted by the server, as they should not be in there if that was the case.

It's not characters, as I said... it's permissions.

QuoteQuestion: Could it be that the server refuses a second connection at the same time from the same IP, as first the 'tocai_smf' dbase is opened and then the phpBB2 dbase seems to fail as I read it in you're stories?

I'm not telling stories :P.  This is not the case, but even if it were it would be avoided, because as I said only one connection is made.

-[Unknown]

Abedie

Hi,

It's partly solved, I created (again) a permission trought the 'grant' option.
Seems there was an error with that, doing it over did the trick.
Our cheep us servers has a hickup sometimes and force one to wait till the command is worked out before one logoff, but it's always guessing when it's done.

I like to thank the both of you for you're efforts to help us. Please remember me if you can think of something I can do for you.

Goodnight,
Abedie

The list about Galery/CMS/Portal using SMF



A dark spot in the light is nearly seen, but a light in the darkness is seen miles away.
Try to be that light for others.

bishop

I have a quick question that may or may not fit in here, but I couldn't find anything like it (maybe I just don't search well  :( ) ...

I've converted my old phpBB2 to SMF. (Sidenote: Best choice I've made in a long time!!) However, we have a separate phpBB2 board on the same server but with a different database and different structure. We'd like to move the posts into one of the SMF forums. Is there any way to do this? I'm thinking that, by hand, one might be able to do so with some effort, but even that seems like a long shot. Is there an easier way to do this? Is there even a way to do this?

Thoughts?

Thanks in advance.
bishop

[Unknown]

How many posts is it?  I'm sorry to say that currently there is no way to... "merge" two forums together.

-[Unknown]

Advertisement: