[SUPPORT] UBB.classic 6.x Convertor [0.3.1]

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
mjd76384
Registered User
Posts: 41
Joined: Thu Dec 28, 2006 12:22 am
Location: North Texas

Post by mjd76384 » Thu Jan 11, 2007 1:30 pm

ssih wrote: So it was a simple matter of copying them from one ubb file to another.


Do you know which files he needs to copy where? Like he said, the UBB board is running fine, so it makes no sense that the converter refuses to work. I've never used any type of converter before, but I've looked at the coding in this converter and I can't find anything in the code that would lead me to believe anything could be wrong.
My wife is married to a rock star!

ssih
Registered User
Posts: 108
Joined: Sat Feb 26, 2005 5:18 pm

Post by ssih » Thu Jan 11, 2007 1:49 pm

Unfortunately, I don't know the names of the files. It's been years since I had this problem and several months since I deleted my last UBB installation.

As I remember, I looked through the converter code and found what file it was looking for to extract these variables from. Then I discovered that either this file didn't exist, or it contained invalid data (or lacked it completely). I found the file that contained the data and simply copied it to the file that the converter was looking for. I'm guessing that one or both of the files included "variable" within the name of the file.

Looking through the phpbb converter code that I have still lying around, I see this code:

Code: Select all

if ($ubb_vars_config = file($classic_vars_path . '/vars_config.cgi'))
So it looks like a file name might be vars_config.cgi, and it's located in $classic_vars_path. Perhaps that variable is something that is set up in the converter's initial startup page?

mjd76384
Registered User
Posts: 41
Joined: Thu Dec 28, 2006 12:22 am
Location: North Texas

Post by mjd76384 » Thu Jan 11, 2007 2:59 pm

It found the vars config file just fine. The problem is that it won't find the other files that it parses from the within the config file.
My wife is married to a rock star!

fround
Registered User
Posts: 9
Joined: Wed Jul 25, 2007 3:25 am

Re: [SUPPORT] UBB.classic 6.x Convertor [0.3.1]

Post by fround » Wed Jul 25, 2007 4:04 am

Just when you thought nobody else could possibly be using UBB.classic... I was recently presented with the problem of converting this dinosaur of a forum, and this converter looks to be a godsend. I've been able to get it to run, but I've encountered the same obstacles ssih has. Topics in random order, and linebreaks replaced with "n". I'm left really wishing ssih had shared what was done to correct the random topics.

As for the linebreak problem, I found the relevant section of code in conv_classic.php:

Code: Select all

$post_subject = $topic_subject;
$post_text = undo_classic_markup($post_info[6], $classic_smilies);
if ($post_text != '')
{
    $bbcode_uid = ( $board_config['allow_bbcode'] ) ? make_bbcode_uid() : '';
    $post_text = addslashes($post_text);
    // Undo the line breaks
    $post_text = str_replace('<br />', '\\n ', $post_text);
    $post_text = prepare_message($post_text, $board_config['allow_html'], $board_config['allow_bbcode'], $board_config['allow_smilies'], $bbcode_uid);
}
That '\\n' jumps out at me. Should it be double-escaped like that? Even if so, soon after there's a similar section of code:

Code: Select all

if ($post_text != '')
{
    $bbcode_uid = ( $board_config['allow_bbcode'] ) ? make_bbcode_uid() : '';
    $post_text = addslashes($post_text);
    // Undo the line breaks
    $post_text = str_replace('<br />', '\n ', $post_text);
    $post_text = prepare_message($post_text, $board_config['allow_html'], $board_config['allow_bbcode'], $board_config['allow_smilies'], $bbcode_uid);
}
Here the linebreak is only singly escaped.

I'm going to fiddle with the escapes and see if that doesn't fix the linebreak problem, though I'm still searching for a fix for the random topic order.


edit: Found the fix. PHP is being picky about the way the linebreak is quoted. The linebreak has to be singly escaped, and double-quotes are required.

Code: Select all

    $post_text = str_replace('<br />', "\n ", $post_text);
I think I also see why the posts aren't in chronological order- They're actually being added to the phpbb database out of order. eg: post 007283 gets added after post 009024, resulting in a higher post ID for the former, which causes it to appear higher on the forum list despite that the post date actually says. I'm still looking for a way to fix this.

User avatar
D¡cky
Former Team Member
Posts: 11812
Joined: Tue Jan 25, 2005 8:38 pm
Location: New Hampshire, USA
Name: Richard Foote
Contact:

Re: [SUPPORT] UBB.classic 6.x Convertor [0.3.1]

Post by D¡cky » Tue Aug 07, 2007 3:49 am

This should solve the topics not displaying in chronological order, http://www.phpbb.com/community/viewtopi ... 3#p1113533
I don't recall there being a problem with posts not displaying correctly.
Have you hugged someone today?

fround
Registered User
Posts: 9
Joined: Wed Jul 25, 2007 3:25 am

Re: [SUPPORT] UBB.classic 6.x Convertor [0.3.1]

Post by fround » Wed Aug 08, 2007 11:32 am

Thanks. I'd tried using the "search this topic" feature earlier, but that just took me all over phpbb.com.

So, I just took the time to browse the entire topic and realized that I've also got the phantom post problem- deleted users in UBB have their posts imported into phpBB's database, and they can even be searched... but they don't show up in topics.

Has anyone found a more elegant solution than compiling a list of former users and setting their user IDs to -1?
eg: someplace in the converter itself we can add the equivalent of "if user doesn't exist, assume ID is -1"

This section of code, perhaps? Starting at line 2278/2666 of conv_classic.php v0.3.1

Code: Select all

// Now lets handle the first post

// Check whether the post was made by a registered user. If it was, we want to
// store the user_id, if not just record it as a guest post
if ($post_info[8] == 'reg')
{
	// Check that there is something in this field, if there is, we use it as there is
	// no need to do any lookups
	if ($post_info[11] != '')
	{
		$poster_id = intval($post_info[11])+1;
		$post_username = '';
	}
	// If there wasn't then this must be an old upgraded post so we need to fall back to
	// looking it up based on something which should be in every post
	else
	{
		$sql = "SELECT user_id FROM " . USERS_TABLE . " WHERE username = '" . sql_addslashes($post_info[2]) . "'";
		$result = $db->sql_query($sql);
		$row = $db->sql_fetchrow($result); // This really needs testing
		$poster_id = $row['user_id'];
		$post_username = '';
	}
}
else
{
	$post_username = sql_addslashes($post_info[10]);
	$poster_id = -1;
}
I'm guessing I need to insert a check inside the first nested condition to determine if the extracted poster_id actually maps to something valid...

Think this would do the trick in its place?

Code: Select all

if ($post_info[11] != '')
{
	$poster_id = intval($post_info[11])+1;

	// Make sure this ID is valid to prevent phantom posts
	$sql = "SELECT user_id FROM " . USERS_TABLE . " WHERE user_id = $poster_id";
	$result = $db->sql_query($sql);
   $rows = mysql_num_rows($result);
	if (!$rows)
	{
		$post_username = sql_addslashes($post_info[10]);
		$poster_id = -1;
	}
	else
	{
		$post_username = '';
	}

}
I'm certain I've munged the syntax somewhere...
D¡cky wrote:I don't recall there being a problem with posts not displaying correctly.
I didn't see many others who also had it either. It's probably something to do with settings or changes in recent versions of php.


Update: The code change successfully detected the right posts, assigning -1 to poster_id and the correct username to post_username. The posts are verified in the database with this information, but they still don't show up in topics... Will have to look into this more.

User avatar
D¡cky
Former Team Member
Posts: 11812
Joined: Tue Jan 25, 2005 8:38 pm
Location: New Hampshire, USA
Name: Richard Foote
Contact:

Re: [SUPPORT] UBB.classic 6.x Convertor [0.3.1]

Post by D¡cky » Wed Aug 08, 2007 1:41 pm

fround wrote:Update: The code change successfully detected the right posts, assigning -1 to poster_id and the correct username to post_username. The posts are verified in the database with this information, but they still don't show up in topics... Will have to look into this more.
I was just about to tell you that you need to check the poster_id in the topics table as well as the posts table.

As far as the posts not displaying in order, I don't understand how that is possible since they are sorted by time. If you applied the fix to viewforum to display the topics by last_post_time instead of by last_post_id, then the topics would be out of order also.
There will still be the problem on the Index page of the incorrect last post displaying in the Last Post column, but that will correct itself once a post is made in that forum.
Have you hugged someone today?

fround
Registered User
Posts: 9
Joined: Wed Jul 25, 2007 3:25 am

Re: [SUPPORT] UBB.classic 6.x Convertor [0.3.1]

Post by fround » Thu Aug 09, 2007 1:40 am

D¡cky wrote:I was just about to tell you that you need to check the poster_id in the topics table as well as the posts table.
That's what I was thinking, so I went and added a check to the else block where the script checks the poster id of a topic:

Code: Select all

else
{
    $poster_id = $poster_id + 1;

    $sql = "SELECT user_id FROM " . USERS_TABLE . " WHERE user_id = $poster_id";
    $result = $db->sql_query($sql);
    $rows = mysql_num_rows($result);
    if (!$rows)
    {
       $poster_id = -1;
    }
}
This correctly detects the topics and adds them to the database under guest authors, so that part's going well at least. A test conversion is underway as I type this; I'll update this post with results shortly.
D¡cky wrote:As far as the posts not displaying in order, I don't understand how that is possible since they are sorted by time.
No, I just wasn't being clear. The posts within topics are in order, for the reason you mentioned. It's the topics that were out of order, but the display fix you pointed me to did the trick. The only hurdle I've got left now is dealing with these phantom posts. :)


Update: Excellent. This works perfectly. The only snag is that there are in fact two post conversion code blocks. The first one I edited as per my previous post was only for the first post in the thread. There's a second one soon after that deals with the remainder of the thread and can be modified in exactly the same way.

I also located a minor bug in the "rest of thread" post processing section. Namely:

Code: Select all

$sql = "UPDATE " . TOPICS_TABLE . " SET topic_last_post_id = $post_id[color=#FF8000], topic_first_post_id[/color] = $post_id WHERE topic_id = $topic_id";
Looks like this was copied directly from the "first post" section and causes first and last post id in the database to always be the same. phpBB seems to take this in stride, though. :?

I'll attach my updated copy of conv_classic.php in case anyone may find it useful.

Thanks for this thread, as without it I never would have had any idea where to start.
Attachments

[The extension zip has been deactivated and can no longer be displayed.]


edsager
Registered User
Posts: 13
Joined: Sun Feb 17, 2008 2:42 am

Re: [SUPPORT] UBB.classic 6.x Convertor [0.3.1]

Post by edsager » Sun Feb 17, 2008 3:12 am

Hello All,

Can you believe this topic is being resurrected again?

I have been tasked by a large association of attorneys to convert their old UBB 6.0.5 board to something new. Hence, I have chosen phpBB.

I have been attempting to use the 0.3.1 Converter, but I keep getting errors.

This is what I have in the vars_config.cgi file:

Code: Select all

%vars_config = (
CGIURL => q!../ubb/boards/cgi-bin/!,
NonCGIURL => q!../ubb/boards/data!,
CGIPath => q!../ubb/boards/cgi-bin/!,
NonCGIPath => q!../ubb/boards/data!,
MembersPath => q!../ubb/boards/cgi-bin/Members!,
VariablesPath => q!../ubb/boards/cgi-bin/!,
cache_pw => "2MPD238U",
Cookie_Number => "2452201.0231",
BBName => q~AILA Message Center~,
DataSource => q!aila!,
UserName => q!aila!,
Password => q!eeshyct!
);
1;
I am working on this project on my PC, which has Apache set up using virtual hosts. I also set up PHP5 and MySQL. I changed my php.ini file to have register_globals = On.

The literal path to the files listed in the code above is: H://vhosts/community/phpBB2/ubb/boards

I have used both literal paths and relative paths for configuring the Converter (currently UBB.classic Version and Path Settings = ../ubb/boards/cgi-bin), but I keep getting the following errors:
Checking PHP Configuration
SUCCEEDED Your server is running a version of PHP which will support this convertor
SUCCEEDED Your server is not running in safe mode. Script timeouts will be disabled for the duration of the conversion process
Checking access to UBB.classic forum
SUCCEEDED Loading UBB.classic configuration file (vars_config.cgi)
FAILED Checking UBB.classic CGI path (ultimatebb.cgi)
FAILED Checking UBB.classic members path (memberslist.cgi)
FAILED Checking UBB.classic non-CGI path (on.gif)
A fatal error has occurred and the conversion process is unable to start. Please check the information above for details of the error(s), and correct them and try again.
I am unsure what to do next.

The large association of attorneys no longer uses this Board (and in fact, started a totally new Board without any of the posts from the old Board, requiring everyone to register anew, which angered many attorneys), but wants for me to preserve it for archival purposes and use on a CD. Getting it to work on the CD is a problem for which I have already found a solution, but I cannot implement it until I can convert the old UBB into phpBB2, and then upgrade that to phpBB3.

I am a total novice when it comes to Perl & CGI.

Can anyone assist me with a solution?

Thank you,
edsager

P.S. If there is any way to export from phpBB3 to XML, that would be a definite plus for my situation, but I suppose that is a separate topic...

User avatar
D¡cky
Former Team Member
Posts: 11812
Joined: Tue Jan 25, 2005 8:38 pm
Location: New Hampshire, USA
Name: Richard Foote
Contact:

Re: [SUPPORT] UBB.classic 6.x Convertor [0.3.1]

Post by D¡cky » Sun Feb 17, 2008 4:20 am

edsager wrote:Hello All,

Can you believe this topic is being resurrected again?
Nope. Hard to believe.

The best I can tell you is to do a search. It looks like your problem may have to do with delimiters. Start with this post, http://www.phpbb.com/community/viewtopi ... 4#p1106854, and read down.
Have you hugged someone today?

edsager
Registered User
Posts: 13
Joined: Sun Feb 17, 2008 2:42 am

Re: [SUPPORT] UBB.classic 6.x Convertor [0.3.1]

Post by edsager » Wed Feb 20, 2008 6:08 pm

Thank you. It worked. I went through most of the thread and found other useful information.

Again, thanks,
edsager

chumpy36
Registered User
Posts: 1
Joined: Sun Apr 13, 2008 3:40 pm

Re: [SUPPORT] UBB.classic 6.x Convertor [0.3.1]

Post by chumpy36 » Sun Apr 13, 2008 4:41 pm

Time for another resurrection...

I have been tasked with moving a UBB Classic 6.7.1 forum to php. The current forum is on a windows box on a dedicated server in memphis. The new box is a dedicated windows box in a data center in houston.

I have more of a network engineering background and not much web experience but I can get sites up and going and have installed php 2.0.22 on the new server with no issues.

I have a copy of the files from the old forum on the new box and am ready to start testing a conversion.

Can I use the converter on the files without having them in a real installation of ubbclassic?

Meaning, can I point the converter to directories on the machine and have it find the information that way to pull it in?

Thank you for any help

Jason

biffstallion
Registered User
Posts: 34
Joined: Thu Aug 28, 2008 3:19 pm

Re: [SUPPORT] UBB.classic 6.x Convertor [0.3.1]

Post by biffstallion » Thu Aug 28, 2008 3:26 pm

Hi,

I have UBB.classic 6.0.3, yup really old. I ran the 0.3.1 version of Graham's converter.

After a few attempts and edits and all that, I managed to complete the first part of the conversion where the Topics get created and all the Users were created.

What is NOT working is the import of the actual messages.

The first time through the conversion, it actually started to import the messages from Forum1. After 249 messages it stopped. And now, no matter how many times I try to "continue" the translation, the only thing I get on my browser is this:

The server encountered an unexpected condition which prevented it from fulfilling the request.
The script had an error or it did not produce any output. If there was an error, you should be able to see it in the error log.



No errors appear in my cgi logs on my hosting provider. I don't believe that the PHP-safe mode is on as the converter said that it was OFF.

I logged onto the phpBB forum and notice NONE of those 250 messages are in that Forum (or any other for that matter). So the converter was able to READ the UBB Forum1 messages, but was not able to push those messages out to my new phpBB board.

Any help would be appreciated!!
Thanks,
Bob

User avatar
D¡cky
Former Team Member
Posts: 11812
Joined: Tue Jan 25, 2005 8:38 pm
Location: New Hampshire, USA
Name: Richard Foote
Contact:

Re: [SUPPORT] UBB.classic 6.x Convertor [0.3.1]

Post by D¡cky » Fri Aug 29, 2008 3:51 am

That sounds like the server is timing out. Unfortunately, Graham is not around to help and I don't know anything about this convertor. All I can suggest is to read through this topic and search through the 2.0.x convertors forum to see if anyone else has had this problem.
Have you hugged someone today?

biffstallion
Registered User
Posts: 34
Joined: Thu Aug 28, 2008 3:19 pm

Re: [SUPPORT] UBB.classic 6.x Convertor [0.3.1]

Post by biffstallion » Tue Sep 02, 2008 7:40 pm

I ended up using the original converter [0.2.6] which once I figured out that the four *.php files were supposed to be in the root of your website, finally worked. Yippee..

What a nightmare this has been.

Thank you.
:)

Locked

Return to “[2.0.x] Convertors”