Previous Thread
Next Thread
Print Thread
Hop To
Joined: Feb 2007
Posts: 57
journeyman
journeyman
Joined: Feb 2007
Posts: 57
I've been using UBB.Classic 6.3 for a long time, and decided, with 300k posts, to upgrade to UBB.Threads. I reindexed everything and successfully upgraded to UBB.Classic 6.7, and then installed PHP, MySQL, phpMyAdmin, and UBB.Threads. After getting all those new programs configured, and making it through the UBB.Threads setup scripts, I started importing my old UBB.Classic 6.7 data. Everything started out fine; it imported all of the member data without a hitch. But when it got to the 'classic_import.php?ubb=categories' page, it died with a simple message:

Importing category: "General Discussion (default)"

I don't have any categories, so I tried creating one (in UBB.Classic), and setting all the forums to use it. Same message. I put it back, and tried navigating to the 'classic_import.php?ubb=boards' page, but that just returns:

Importing forum: "shanesforum1"

Any ideas? Note that I've checked the returned HTML and found no error messages -- after the message is just <br />.

Also, is there an easy way to dump the contents of the MySQL database so I can try the import fresh again? As much as I know about VB, C#, and Access, I'm not a pro at MySQL or PHP.

Thanks in advance,

Shane


RnJpZW5kc2hpcCB3aXRoIHRoZSB3b3JsZCBpcyBob3N0aWxpdH
kgdG93YXJkcyBHb2QuICBKYW1lcyA0OjQ=
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
It *could* be that it's running into an error and php is configured to not display errors to the browser. If you have access to the php.ini file you can check this, I believe it's display_errors or something like that.

As for dumping the contents of the database and starting fresh. Basically all you need to do is drop all of the tables or the entire database if UBB.threads is the only thing inside and then rerun the install/createtable.php script.

Joined: Feb 2007
Posts: 57
journeyman
journeyman
Joined: Feb 2007
Posts: 57
Thanks, now I can see the error message. It is:
Quote
Importing category: "General Discussion (default)"

Warning: html::include(languages//generic.php) [function.html-include]: failed to open stream: No such file or directory in D:\Data\Inetpub\websites\mywebsite.com\ubbthreads\libs\ubbthreads.inc.php on line 799

Warning: html::include() [function.include]: Failed opening 'languages//generic.php' for inclusion (include_path='.;C:\php5\pear') in D:\Data\Inetpub\websites\mywebsite.com\ubbthreads\libs\ubbthreads.inc.php on line 799

Notice: Smarty error: unable to read resource: "not_right_bare.tpl" in D:\Data\Inetpub\websites\mywebsite.com\ubbthreads\libs\smarty\Smarty.class.php on line 1088

It seems that it isn't adding the word 'english' in the pathname. I checked the 'languages' page of the control panel; English is set as default and active. What should I check next?


RnJpZW5kc2hpcCB3aXRoIHRoZSB3b3JsZCBpcyBob3N0aWxpdH
kgdG93YXJkcyBHb2QuICBKYW1lcyA0OjQ=
Joined: Feb 2007
Posts: 57
journeyman
journeyman
Joined: Feb 2007
Posts: 57
p.s. Oops! It looks this thread should be under the Importing forum...


RnJpZW5kc2hpcCB3aXRoIHRoZSB3b3JsZCBpcyBob3N0aWxpdH
kgdG93YXJkcyBHb2QuICBKYW1lcyA0OjQ=
Joined: Dec 2003
Posts: 1,796
Pooh-Bah
Pooh-Bah
Joined: Dec 2003
Posts: 1,796
Looks like you don't have a default language set?

(languages//generic.php)


- Allen
- ThreadsDev | PraiseCafe
Joined: Feb 2007
Posts: 57
journeyman
journeyman
Joined: Feb 2007
Posts: 57
It looks that way, but English is set as default and active in the control panel. I'm hazarding a guess that line 799 in ubbthreads.inc.php should reference $config['LANGUAGE'] not $user['USER_LANGUAGE'], but I don't know. In any case, fixing that won't work, because it's trying to find the languages folder as a subfolder of the importers folder. And even if I copy the languages folder to the importers folder, I still get the Smarty error, and I have no idea how to fix or patch that.


RnJpZW5kc2hpcCB3aXRoIHRoZSB3b3JsZCBpcyBob3N0aWxpdH
kgdG93YXJkcyBHb2QuICBKYW1lcyA0OjQ=
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
Hmm, it's actually triggering the not_right error function which *should* never happen during an import. I need to see why that's happening as it should bypass that if an error is encountered and just display it in raw html.

Joined: Feb 2007
Posts: 57
journeyman
journeyman
Joined: Feb 2007
Posts: 57
FYI, the error was occuring in the first do_placeholder_query line after it echos the "Importing Category:" line (sorry, I don't know the line #). Apparently, it was trying to insert null values into the database (all three fields), which is not allowed. The source vars_cats.cgi file had only a CRLF in it, which I removed, and then the script ran fine and passed into the next stage - importing the forums. But now I'm stuck there with the exact same 'smarty' error -- probably another DB problem. It sure would help if it printed the errors! I'll keep you posted if I can figure out anything else. Please let me know if you find a way for the script to print the error messages. Thanks!


RnJpZW5kc2hpcCB3aXRoIHRoZSB3b3JsZCBpcyBob3N0aWxpdH
kgdG93YXJkcyBHb2QuICBKYW1lcyA0OjQ=
Joined: Feb 2007
Posts: 57
journeyman
journeyman
Joined: Feb 2007
Posts: 57
It seems that it couldn't import the forums because of a similar problem: it tried to insert a null value in the categoryid field, instead of inserting '1' in there. I patched it, and then it imported the forums and is now cheerfully importing posts upon posts...

I had already tried creating a category and assigning all the forums to it, but for some reason that didn't work. I would suggest that you update your import scripts to handle an empty vars_cats.cgi file and uncategorized forums -- and of course, show database errors so these problems can be fixed easier.

Thanks!

Shane


RnJpZW5kc2hpcCB3aXRoIHRoZSB3b3JsZCBpcyBob3N0aWxpdH
kgdG93YXJkcyBHb2QuICBKYW1lcyA0OjQ=
Joined: Feb 2007
Posts: 57
journeyman
journeyman
Joined: Feb 2007
Posts: 57
Rick,

Now I'm running into more errors while importing some of the posts. If you could track down that bug that's causing the database errors to be hidden (because it's trying to load the 'not_right' error function), it would sure make fixing these import scripts easier! I will keep you posted as I continue to diagnose my import.

Thanks,

Shane


RnJpZW5kc2hpcCB3aXRoIHRoZSB3b3JsZCBpcyBob3N0aWxpdH
kgdG93YXJkcyBHb2QuICBKYW1lcyA0OjQ=
Joined: Jun 2006
Posts: 196
I
enthusiast
enthusiast
I Offline
Joined: Jun 2006
Posts: 196
Try doing the following in /libs/mysql.inc.php

Find: (Line 334)

Code
		if (defined('ADMINISTRATORS')) {
			global $admin;
			$admin->error($show_error);
		}
		else {
			$html -> not_right_bare($show_error);
		}

Change to

Code
		if (defined('ADMINISTRATORS')) {
			global $admin;
			$admin->error($show_error);
		} else if (defined('IS_IMPORT')) {
			echo $show_error;
		}
		else {
			$html -> not_right_bare($show_error);
		}

Now, at the top of classic_import.php, add

Code
define('IS_IMPORT', true);

This is obviously a kludge, but this should work. (If it doesn't, you just need to add more code various places)

Rick, I'm gonna send you my rewritten version of mysql.inc.php that handles this cleaner


Joined: Feb 2007
Posts: 57
journeyman
journeyman
Joined: Feb 2007
Posts: 57
That helps SOOOO much, thank you!

Now I know what my next problem is: "Data too long for column 'POST_BODY' at row 1"

I found the spot to insert the line of code, but I don't know PHP. Can anyone translate this code to PHP for me? (I've done a mockup in VB/C)

if (Len($raw_post) > MAX_POST_LENGTH) {
$raw_post = Left($raw_post, MAX_POST_LENGTH)
}

Also, I don't know what the maximum posting length is. I examined the field with PHPMyAdmin, but it didn't seem to show a maximum length for the field. As the field is of type 'text', I'm actually surprised that there's a length limitation at all.

Thanks in advance,

Shane


RnJpZW5kc2hpcCB3aXRoIHRoZSB3b3JsZCBpcyBob3N0aWxpdH
kgdG93YXJkcyBHb2QuICBKYW1lcyA0OjQ=
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
If you have a lot of long posts, you can change the length of the POST_BODY and POST_DEFAULT_BODY fields to hold a longer value. By default, text fields will hold 65,535 characters.

If you want to allow more, you can alter the database with the following SQL command:

alter table ubbt_POSTS change POST_BODY mediumtext, change POST_DEFAULT_BODY mediumtext

Joined: Feb 2007
Posts: 57
journeyman
journeyman
Joined: Feb 2007
Posts: 57
Thanks, I edited the createtable.php script and started fresh; it's importing now.


RnJpZW5kc2hpcCB3aXRoIHRoZSB3b3JsZCBpcyBob3N0aWxpdH
kgdG93YXJkcyBHb2QuICBKYW1lcyA0OjQ=

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
Is UBB.threads still going?
by Aaron101 - 04/01/2022 8:18 AM
Who's Online Now
1 members (Ruben), 1,248 guests, and 268 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)