Not logged in. · Lost password · Register
Forum: Support General support RSS
Importing phpbb2 fails, why ?
Page:  1  2  next 
Avatar
ldaoust #1
User title: Software Developer
Member since Dec 2005 · 12 posts · Location: Canada
Group memberships: Members
Show profile · Link to this post
Subject: Importing phpbb2 fails, why ?
I have installed successfully UNB and is working fine. It is using a MySQL database.

Now I am trying to import my phpbb2 database into unb and it fails at step 2 with the message UNB Error: No username set for database connection..

To import I start the install.php script and choose Import from another newsboard. Then, the choice I have is to select phpBB 2.0.x .

First page asks for database name, table prefix and avatars location. I give all the information and click continue, then I get the message mentionned.

Can someone help me ?
Thanks,
Lou.
--
Lou
This post was edited on 2005-12-22, 18:24 by Yves.
Edit reason: Assigned to user
Avatar
Yves (Administrator) #2
User title: UNB developer & webmaster
Member since Jan 2004 · 3856 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Cross-reference: http://newsboard.unclassified.de/forum/thread/844 (German topic, same problem)

This seems to be a more common problem. I'll have a look into it.

kamikasi from the other thread solved the problem for now by hard-coding the correct username into a PHP source code file, but didn't include further details. I'll back-reference the thread, maybe he can explain it here.
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
Avatar
Yves (Administrator) #3
User title: UNB developer & webmaster
Member since Jan 2004 · 3856 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
From I quick code review I cannot explain the problem. I don't have a phpBB installed now on my machine so it will take some time until I can make a real test.
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
Guest (Guest) #4
No profile available.
Link to this post
Hi,

I've got this problem,too.
But I've solved it on a strange way... :scared:

I've installed an older Version of UNB (1.5.3) an importet my data with it's import skript - worked well! ;-)
Then I've made an update to 1.6 - now everything is fine. :-D
Not a so easy way like this german guy used but it worked for me!

Yves, there has to be a difference between the old an new import script! Do not know where but it is out there...  8-(
Avatar
Yves (Administrator) #5
User title: UNB developer & webmaster
Member since Jan 2004 · 3856 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Yeah, good try. There are actually a ton of differences, but I think I have found an interesting part. For security reasons, the database object is made forgetting its account data after a successful connection. What I didn't think of was that the import script will read this very data from the database object to open the second connection to the import tables.

Removing the $UNB['Db']->Forget(); call from common.lib.php should solve it. Please let me know so I can disable this call for installation scripts.
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
Avatar
ldaoust #6
User title: Software Developer
Member since Dec 2005 · 12 posts · Location: Canada
Group memberships: Members
Show profile · Link to this post
Yves,

I tried your suggestion and it did work...to a certain point. All forums and thread have been imported but there was a problem importing users. User table is empty, got message [users] add error: Unknown column 'ActivateKey' in 'field list'

Here is my situation. My UNB database was created on installation and I added some forums to it yesterday, after posting this message, so I could have something to work with. This morning I read your replies so droped all the tables and proceed with the importing after removing the call to $UNB['Db']->Forget();. Then I got this message [users] add error: Unknown column 'ActivateKey' in 'field list'  :-/

My environment is:
OS: Windows XP SP2
PHP 5.0.5
MySQL 4.1.12
UNB 1.6
phpBB2 2.0.18
--
Lou
This post was edited on 2005-12-22, 18:24 by Yves.
Edit reason: Assigned to user
Avatar
Yves (Administrator) #7
User title: UNB developer & webmaster
Member since Jan 2004 · 3856 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Ok, then we've found the next bug. The column ActivateKey has been renamed to ValidateKey. The old name appears once in the file import_phpbb2.php, you can replace it with the new name.

Btw, the import script drops and re-creates all tables itself because it's meant to be run without a previous UNB installation and it can only import into empty tables anyway.
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
Avatar
ldaoust #8
User title: Software Developer
Member since Dec 2005 · 12 posts · Location: Canada
Group memberships: Members
Show profile · Link to this post
Works fine now. Thanks Yves.

There is still one minor issue. Not sure if I should start a new thread for this one.

All my environment is in English but some of the forums in phpBB2 had french characters and after the impor,  those characters are not displayed correctly in UNB.

example, instead of Générale I get Générale .

After comparing the tables I see a difference in the Collating. All my other database tables have collating set to latin_sweedish_ci but UNB has tables collating set to utf8_general_ci.

Any idea (work around) ?

Lou.
--
Lou
This post was edited on 2005-12-22, 18:23 by Yves.
Edit reason: Assigned to user
Avatar
Yves (Administrator) #9
User title: UNB developer & webmaster
Member since Jan 2004 · 3856 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Does it help to insert this code
  1.     $db0->useUTF8 = rc('db_utf8') !== null ? rc('db_utf8') : true;
in file import_phpbb2.php before "$db0->Open()"?
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
Avatar
ldaoust #10
User title: Software Developer
Member since Dec 2005 · 12 posts · Location: Canada
Group memberships: Members
Show profile · Link to this post
It did not work. Same result.

I am trying to undersatnd the code. Where does the rc('db_utf8') comes from ?
--
Lou
Avatar
Yves (Administrator) #11
User title: UNB developer & webmaster
Member since Jan 2004 · 3856 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
The rc function reads configuration values from board.conf.php. The db_utf8 config value determines whether to use MySQL's Unicode capabilities or not. Normally this is auto-detected but setting it to 0 force-disables UTF8 usage in MySQL (this is how UNB worked before 1.6 and still does with MySQL up to 4.0). The database object is informed about that configuration value with this object field in common.lib.php when opening the main database connection. Well, and this seems to be the point where my last mistake was: The import scripts of course shouldn't use UTF8 because the other database systems don't as well. So maybe it helps to set db_utf8 = 0 in the config file... I have no other idea right now.
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
This post was edited on 2005-12-22, 18:20 by Yves.
Avatar
ldaoust #12
User title: Software Developer
Member since Dec 2005 · 12 posts · Location: Canada
Group memberships: Members
Show profile · Link to this post
In reply to post #10
Excellent.

I found the exact same solution at the same time you posted your reply.

Setting db_utf8 = 0 in the config file keeps the original collating and now everything displays ok.

ok, that should wrap my case.

Thanks for all your help. I really like this forum engine. I tried phpBB and Snitz Forums 2000 (an ASP based forum) and prefer yours.

Great work.
Lou.
--
Lou
bezoard #13
Member since Jan 2006 · 5 posts
Group memberships: Members
Show profile · Link to this post
as many people, the bug "UNB : cannot connect to the database" occurs, i solved it with your solution
the second problem concerning "activkey " occurs also but the fact is and that is my problem :

if a change validakey to activakey
the import script disappears from the list when i want to import my database ..

whereas originally, the scritp appears so i can't succeed the import ?

any solutions ?

thanks
Avatar
Yves (Administrator) #14
User title: UNB developer & webmaster
Member since Jan 2004 · 3856 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
How did you make that change? I suppose the file was too badly corrupted in that process so that it isn't recognised anymore by the installer.
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
bezoard #15
Member since Jan 2006 · 5 posts
Group memberships: Members
Show profile · Link to this post
thanks for this quick help, in fact i have just renamed

as it is explained in this topic
i have renamed " activatekey" in in the import_phpbb2.php script  by "validekey" ...
and i m sure, i dit it well ... :-p

i will try one more time to be sure ..
This post was edited on 2006-01-11, 02:17 by bezoard.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Page:  1  2  next 
Go to forum
This board is powered by the Unclassified NewsBoard software, 20120620-dev, © 2003-2011 by Yves Goergen
Page created in 222.6 ms (165 ms) · 135 database queries in 127.9 ms
Current time: 2013-06-20, 06:11:55 (UTC +02:00)